Android Question Substrings

ElliotHC

Active Member
Licensed User
I have searched everywhere on here and can't seem to find how to get the left side part of a string.

I have "ABCDEFGHIJK" I need "ABC"

I am using

B4X:
Log(MyString.Substring(3))

But I get "IJK", it's working left to right and I need right to left.[/code]
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

ElliotHC

Active Member
Licensed User
Sorry, yes that is correct Don.

I was missing the 2 after substring (substring2(x,x))

I couldn't get it to work.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Sorry @DonManfred ... I'd go with @mc73
his answer is something other than mine.
I just stated that
B4X:
str.SubString(3)
NEVER returns IJK when the str is "ABCDEFGHIJK"
But I get "IJK"
away from that the TO is giving unclear questions.
I have "ABCDEFGHIJK" I need "ABC"

and later he wrote (same post)
But I get "IJK", it's working left to right and I need right to left.

So i was only concentrating on the wrong result from Substring(3)
 
Upvote 0
Top