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

mangojack

Well-Known Member
Licensed User
Longtime User
Im Confused ... :confused:

Sorry @DonManfred ... I'd go with @mc73

... Or are we still a bit shell shocked from New Years Celebrations ?:)


Edit ... @DonManfred ... Apology .. I reread / get your post now .
 
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