249
Views
5
Comments
Solved
String_Split without a delimiter
Question
Application Type
Reactive

I want to break the below string into a list with each letter/number as a separate element. 

"UTCU5325347"



How may I do this as the string does not have a delimiter that I can use for the String_Split action?

2021-11-18 18-03-41
AJ.
Solution

Hello @Roisin Woolley 

And here's another way of doing it (without using regex). Oml attached.

Regards,

AJ

SplitTextByChar.oml
UserImage.jpg
Roisin Woolley

Thank you AJ, I have used this solution and works perfectly :) 

2021-11-18 18-03-41
AJ.

Pleased to hear it works for you :) Happy (low) coding!

2018-10-29 08-31-03
João Marques
 
MVP

Hi Roisin,


You can workaround this very easily.

If you use Regex_Replace from Text, you can insert a space (or any other character for that matter) between each characater. Something like this:


If you use the above find (.\*) and replace patterns $1  (there is a space after the $1; a space because that's the delimiter I chose), you can see the result on the green message on top, and then use the String_Split to split it for the space.


Kind Regards,
João

2021-11-18 18-03-41
AJ.
Solution

Hello @Roisin Woolley 

And here's another way of doing it (without using regex). Oml attached.

Regards,

AJ

SplitTextByChar.oml
UserImage.jpg
Roisin Woolley

Thank you AJ, I have used this solution and works perfectly :) 

2021-11-18 18-03-41
AJ.

Pleased to hear it works for you :) Happy (low) coding!

2020-09-21 11-35-56
Sachin Waghmare

Hello Roisin,

Do you have fixed length of this string along with format as well? If yes, then you can try Substr function. 

If you want first 4 characters then you can get this function by passing Substr("UTCU5325347", 0 , 3) and then to get the numbers use Substr("UTCU5325347", 4, 10). 

This solution only works when you have the fixed length string. I have attached an sample OML for this suggested solution.

Thanks & Kind Regards,

Sachin

SplitTextWODelimiter.oml
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.