Android Question Substr function (parsing) Left, Right and Middle

ocalle

Active Member
Licensed User
Longtime User
Hello, In other languages i have this fuctions to handle strings, can you say which are like that?

I used

Left, Right and Middle


U have an string as "abcdefg" name chain

and

Left(chain, 2) give "a"
Right(chain,2) give "g"

and Middle(chain,3,2) gives "cd"

Need know how handle this, i need parse some incoming strings

Best regards

Osvaldo
 

eurojam

Well-Known Member
Licensed User
Longtime User
example:
B4X:
Dim s = "abcdefg"
Log(s.SubString2(0,1)) 'left(1)
Log(s.SubString(s.Length-1))  'right(1)
Log(s.SubString2(2,4)) 'middle(2,3)
 
Upvote 0

ocalle

Active Member
Licensed User
Longtime User
Dim grats="ManyThanksGreat!"

log(s.substring2(4,5))
 
Upvote 0
Top