Help with String

astf

Member
Licensed User
Longtime User
Hi everyone...

I have a string with de value:
string1 = 3,251,54,874,521,2548,

each number for this string is a register in one table, total of 6 registers in this string....
i need break the string...

how can i separate the values...?
i need update a register in a sqlite table for each value in this string...
 

DouglasNYoung

Active Member
Licensed User
Longtime User
astf,
Hve a look at regex.split -> http://www.b4x.com/android/help/regularexpressions.html#regex_split`or use the search function - its exactly what you're looking for.

Cheers,
Douglas
 
Upvote 0

astf

Member
Licensed User
Longtime User
thx... Douglas,
that is exactly what i want...

but how can i count the strings?

for each value in the string i need to do a update in a sqlite table...

for value = 3
query = "Update ........ Where id = 3 "

for value = 251
query = "Update ........ Where id = 251 "

i need a update for every value....
 
Last edited:
Upvote 0

kickaha

Well-Known Member
Licensed User
Longtime User
B4X:
Dim String1 As String
string1 = "3,251,54,874,521,2548"


Dim StringValues() As String
StringValues = Regex.Split(",", String1)

For count = 0 to StringValues.Length -1
' do what you need with each StringValues(count)
Next
 
Upvote 0
Top