iOS Question LastindexOf2 Problem

hatzisn

Well-Known Member
Licensed User
Hi everyone,

Consider the following line of code:

B4X:
iU2 = TextToSpeak.LastIndexOf2(sDelimiter, iEnd)
Where sDelimiter="." and iEnd=1000.

Is it possible ever to return a value greater than 1000 if there is an sDelimiter in a position lesser than 1000. Even if there is not is it possible to return such a value (>1000) ?

Well it does

Any suggestions?
 

ThRuST

Well-Known Member
Licensed User
Hi @hatzisn I believe you should better provide more details about what library/modules you are using to increase chances to get an accourate response, except this :)
You might want to send the author of the library a personal message or keep search the forum, even google might do the trick.
 

LucaMs

Expert
Licensed User
[B4J - I don't have B4i]

B4X:
    Dim TextToSpeak As String
    Dim sDelimiter As String = "."
    Dim iEnd As Int = 1000
    Dim iu2 As Int
    
    For i = 1 To 110 ' TextToSpeak will be 1,100 long
        TextToSpeak = TextToSpeak & "asd.dsa.12"
    Next
    iu2 = TextToSpeak.LastIndexOf2(sDelimiter, iEnd)
    Log(iu2) ' 997 - correct
 
Top