Hi All,
PFA,
Wanted to split string and assign to 4 local variables,separator " "
If the string is ex new Delhi
then name1=New
Name2=Delhi
If the string is ex new Delhi India Delhi India
Then Only name1,Name2,Name3,Name4 to populated
@Preeti zade , as @Mihai Melencu mentioned before, you shouldn't use a space to split the string.
However, if you really want to use a space, just replace the comma with one.I'm also attaching a demo showing how you can check the value of a specific position within the list.
To see it in action: enter the string using a comma as a separator and click 'Go' to generate the split list. Once the list is generated, you can click on any string to see its value.
Hi Rui,
Thank you for the reply,
Actually I need to separate these list into 4 names to pass to api fields(Apa has name1,name2,name3,name4 fields.(Full name into 4 names )So I have done below approach,
Regards
Thanks for the update, glad it worked out!
Hi @Preeti zade ,
You should not split by every space, because "New Delhi" must stay together as one name.
You need a separator that clearly separates the names, for example comma ,, pipe |, or semicolon ;.
Yes but they want delimiter space as of now
But the requirement is to separate into multiple names and pass to api,full name to be split
Based on your question and the example, I think you might be confusing records with record lists. Check out the attached example to see how it's done
But I am looking If user enters full name withe space ,I want to separate each straing and pass in name1,name2,name3 and name4 api fields,If he enters two words with separator space then only name1 and nam2 will go,
First use trim to remove space first and lastSecond use string split then we have list and you ignore list[0]. Additionally, if an error occurs, please replace space by comma before use string split.
Another thing I'm thinking about is whether names can have more than one word.