Android Question error in CharAt

Discussion in 'Android Questions' started by MhdBoy, Aug 28, 2015.

  1. MhdBoy

    MhdBoy Member Licensed User

    Hi there,
    i have problem with String CharAt method in my app.
    my code:
    Dim sText as String = " <b> "
    If sText.CharAt(i) = "<" Then
    If sText.SubString2(0,i) <> "" Then
    Log(sText.SubString2(0,i))
    End If
    End If

    error:
    [​IMG]
    how i can fix this error?!

    tnx a lot
     
  2. HotShoe

    HotShoe Well-Known Member Licensed User

    I'd guess that you are using a for loop to go through the string like:

    for i = 0 to stext.length

    where it should be:

    for i = 0 to stext.length - 1

    Hard to know without seeing more of the sub though.

    --- Jem
     
    MhdBoy, RandomCoder and DonManfred like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice