What is the best way to create a list from a string with values seperated by comma? If the lengths was always same I could use substring2. I can still use substring2 but it won't be a good code. Is there a better way to explode this string into a list ?
For example
s= "USD,TR,MOON"
I want to add all these words into a list
CSV - comma separated values format. The various StringUtils libraries include methods for loading and saving CSV files. However these methods have a few drawbacks: - They work with files instead of strings. This is especially problematic if the input is not UTF8 encoded. - As they are...
I can't find string split function . How to get it ? for eg: dim temp as string dim rst() as string temp = "Ravi,Hari,Raman,Anitha,Vinod" rst = Split(temp,",") Actually array variable rst shoud get splitted strings from temp . P.S: Last line in code does not work .
www.b4x.com
B4X:
Dim components() As String
components = Regex.Split(",","abc,def,,ghi") 'returns: "abc", "def", "", "ghi"
components(0)="abc"
components(1)="def"
components(2)=""
components(3)="ghi"