How to split the given integer value?

Hi All,

The given input integer value is “3247893”
I want to split the given value as below mentioned.
input:3247893
output1:324789
output2:3

please help me

Hi @vivekktr

You can try with Regex expression

System.Text.RegularExpressions.Regex.Match(YourString,"\d{6}").Tostring

image

System.Text.RegularExpressions.Regex.Match(YourString,"\d$").Tostring

image

Regards
Gokul

@vivekktr is the integer length is fixed? if it’s fixed then find the solution:

split.zip (1.2 KB)

Hello @vivekktr
Try this
YourString=“3247893”

Output2=YourString.Last         ---> Output2=3
Output1=YourString.Remove(YourString.Count-1)     --->Output1=324789

integer length not fixed

@vivekktr Try this for dynamic result

Can you share the exact input @vivekktr

@vivekktr

in assign
to get first case Value1 = Cint(value.Tostring.Substring(0,Value.Tostring.Length-1))

for 2nd case Value2 = Cint(Value.Tostring.Substring(Value.Tostring.Length-1,1))

image

Okay then try this

output

image

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.