Substring.....get ="123654" only 123654(numbers)

Need Help…
.
.
.
Help me to get split numbers from the given string =“12354”.
I tell you what i try…

first i put =“0123654” this special no into one variable
then i write below code in assign block
insertval1.Substring(2,insertval1.Length-7)
but ti gives me output like 123654"
and i try for this output=0123654

Thanks in Advance!!!

Try test=“0123654”
then in Assign give test.substring(0,test.length)

2 Likes

Fine
hope this expression in a assign activity will help you get the output we need
str_output = System.Text.RegularExpressions.Regex.Match(str_input,“\d+”)

where str_output = 0123654

Cheers @Shanmukh08

2 Likes

Hi

You can use this
str=“0123654”
result = str.Substring(1,(str.Length-2))

thanks for reply but it gives output =“0123654”

substing_09102019.xaml (4.7 KB)

Hello @swanand_deshmukh

Thank you for your inquiry, look:

image

  • interval.Substring(1,interval.Length-1).ToString this sentance says that you will get the string starting after 1 character and up to the the last characters minus 1:

Regards,


Don’t forget to like us :heartpulse:
Happy Automation! :sunglasses:

Thanks @Palaniyappan for giving new ideas

1 Like

Cheers @Abisha

yeeee we r about to solve but ur code is give this output "0123654

so i do changes like
1]
str=“0123654”
result=str.Substring(2,(str.Length-2))
then it gives me output 123654"

and
2]
str=“012354”
result=str.Substring(1,(str.Length-3))
then it give me output "012365

I am not sure but when i kept that in log message i did not receive any quotes . The output just came as 0123654

sir the string is

=“0123654”

if u get it like

“0123654” this
so thats why u got the 0123654 this out put

@swanand_deshmukh str=“0123654” from this what is the output you are expecting.

same what output you are expecting

Actually my input is

=“0123654”

and my Expecting output is 0123654

1 Like

yah kindly try with that expression
where str_input will be holding your input
System.Text.RegularExpressions.Regex.Match(str_input,“\d+”)

Cheers @swanand_deshmukh

Hi,
This one gives me correctly and @Palaniyappan solution is also working correctly
str.Substring(1,(str.Length-2))

Thanks bro it works

1 Like

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