String functions

straybullet

Member
Licensed User
Longtime User
Ok I maybe missed it in the docs...


But I want to see if a string begins with the number 1 and if so remove it from the beginning only. I don't care if the number 1 appears anywhere else in the string, it as long as its not at the beginning.


Some languages have strleft and strreplace, but do not see them in B4a, any suggestions will be greatly appreciated.

Thanks
 

NJDude

Expert
Licensed User
Longtime User
There's no "TrimLeft" but you can do something like this:
B4X:
Dim str As String

str = "1 Hello there"

If str.StartsWith("1") Then

   str = str.SubString(1)
         
End If

Msgbox(str, "")
 
Upvote 0

Thomas Wong

Member
Licensed User
Longtime User
Encrypt and Decrypt

Hi,
Any idea how to use the Encrypt and Decrypt function in StringFunctions library?

How can I specify the salt/key for it?

Regards,
Thomas
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…