Android Question How to remove spaces from List item set to a string

JEG

Member
Licensed User
Longtime User
Dim s1 as string

s1=List1.Get(n)
s1.trim
s1.replace(" ","")

s1 still contains spaces. Msgbox(List1.IndexOf(" <Document>"),"") shows this
How can the spaces be removed?
 

mangojack

Well-Known Member
Licensed User
Longtime User
try ..
B4X:
s1=List1.Get(n) 
s1 = s1.replace(" ","")
 
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
Dim s1 as string

s1=List1.Get(n)
s1.trim
s1.replace(" ","")

s1 still contains spaces. Msgbox(List1.IndexOf(" <Document>"),"") shows this
How can the spaces be removed?

You need to assign the result. Try this:

B4X:
Private s1 as String = List1.Get(n)
s1 = s1.Trim.Replace(" ", "")

- Colin.
 
Upvote 0
Top