B4A Library String Functions

stanks

Active Member
Licensed User
Longtime User
i was talking about your 1st thread here. check description for SplitGetWord func
 

chrjak

Active Member
Licensed User
Longtime User
nice work BUT is this lib the reason why i have a read data permission in my app?
Edit: I just saw: Yes it is.
But why needs it to write on the external storage?
How to disable this? How to explain that a string reformer uses this permission...!?
I use only split
 
Last edited:

chrjak

Active Member
Licensed User
Longtime User
but you can convert it!?
(for i = 0 to string().indexes
list.add(string(i))
next)
Edit: It worked. Thanks Klaus
 
Last edited:

chrjak

Active Member
Licensed User
Longtime User
yes
This was only the manifest for the code
Ragards
 

margret

Well-Known Member
Licensed User
Longtime User

The new library 1.05 has new commands(SaveData & GetData) to write and read data. This is why the permission is needed. If you use one of the previous versions, they do not require these permissions.
 

NJDude

Expert
Licensed User
Longtime User
If you are sure you're not going to need that permission then remove it, add this line to your manifest using the manifest editor:
B4X:
RemovePermission(android.permission.WRITE_EXTERNAL_STORAGE)
 

howt

Member
Licensed User
Longtime User
Hi Margret,

I have a problem with the InString-Function:
STRA = "abc"

I = fs.Instr (STRA, "abc")
I = 0? why? I would still be 1 or?

next example:
I = fs.Instr (STRA, "xyz")
I = 0, that is correct!

the other functions are great!

Walter
 

howt

Member
Licensed User
Longtime User
not found = 0
Found at the first position = 0
How can I distinguish that?
In Visual basic is found the first position = 1!?
 

margret

Well-Known Member
Licensed User
Longtime User
Not found = -1, anything over -1 = found. I just ran this test code:

B4X:
Log(jstr.InString("Mr. Jim Hall","Jim"))
Log(jstr.InString("Mr. Jim Hall","Bill"))
Log(jstr.InString("Mr. Jim Hall","Hall"))
Log(jstr.InString("Mr. Jim Hall","Mr"))

Log Results:

Even the arrays in B4A start at position 0 as the first element. The List items do as well.
 
Last edited:

chrjak

Active Member
Licensed User
Longtime User
Wow these are great News!
Thanks!
 

sultan87

Active Member
Licensed User
Longtime User
Wow these are great News!
Thanks!
Hello Margret
I want to replace a character with another in a string
such as replacing the "K" by an "R" in the string
[Deal "N: KJ.Q63.AK743.542 AQT862.4.QJ9.T96 54.AKJT7.862.AKJ 973.9852.T5.Q873"]
I tried with sf.stuff, but it does not replace a character
there no one INSTR function as in VB
Best regards
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…