Split string into characters

string

#1

Hi all

Apologies, but I’m having a total mind blank.

I have a string variable which, for this example, is “AB1C22D3”

What I want is to enter the first character (A) into somewhere, tab, enter the second character (B), and so on until the end.

It’ll be a mixture of letters and numbers with no spaces in. The length will often differ too. I can’t think of a way to break it up, I’ve searched on the forum and haven’t found anything.

Thanks in advance for any help!


#2

@Short, you can try convert it to a char array.

String.ToCharArray()

Or

Even access like string (0) -> first character
String (1) -> second character
and so on

Regards,
Dominic :slight_smile:


#3

Hi,
@Short
1.Create string variable(value)
2. assign Value="AB1C22D3"
3.Create char array variable(arrayvariable)
4 assign arrayvariable = value.ToCharArray()
5 using for Loop

Regards,
Arivu


#4

Thanks @Dominic and @arivu96, great helps! Got it working now :slight_smile: