iOS Question LastindexOf2 Problem


Well-Known Member
Licensed User
Hi everyone,

Consider the following line of code:

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?


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.


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

    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"
    iu2 = TextToSpeak.LastIndexOf2(sDelimiter, iEnd)
    Log(iu2) ' 997 - correct


Well-Known Member
Licensed User
@LucaMs the code comes from the module TTSFunctions I have posted in B4A forum. In B4A the same code works perfect

@Erel Here is a test Project in B4i... Find it attached...