# How to separate digits

I have digit 1234-1233-1233-7

How to separate it and storing in diff - 2 variable

Hi @balkishan,

If you want to split , split by - and you will be having array of values and now you can store in different variables

Hi @balkishan,

Please refer to this post by @ClaytonM:
Split dynamical string

Thanks and regards.
Despi

Could you specify your problem? If you want to split this digit by “-” use method .Split("-"c)

1234-1233-12353-7

this us dynamic first i want to take 4 digits then 4 digits then 5 and then 1 digits

@anil5 suppose I have 3456-32345-344-1
so I need 3456 in one variable and 32354 in second , 344 in third and 1 is fourth variable.

Can you perform step mentioned in the above post by me and let us know .

@anil5 This is my requirement Anil

uppose I have 3456-32345-344-1
so I need 3456 in one variable and 32354 in second , 344 in third and 1 is fourth variable.

For this requirement only solution is provided.

1. Split the string with hyphen
2. Store in array of values
3. Array(0) represent first value and array(1) represents second value and so on.

Can you try and let us know

2 Likes

Right @balkishan. So you will assign that one to an array of string after you split it.
Then you can get those values by using index.
Example: 123-145-11-12
You will get that by:
arrayName(0).ToString is 123
arrayName(1).ToString is 145
and so on

1 Like

@anil5 @Jan_Brian_Despi @srogo Thanks guys

1 Like