Create String

Hi Guys,

I am getting a string “40401.00\r\nservices” this by error i want only the number if i use remove last thing. i need to define the length which is not fixed. So can you help me out in this.

Thanks

Hi @Gaurav_Kumar2

Please use Regex:
Regex.Match(theString, "^\S{0,}").Value

Thanks and regards,
Despi

1 Like

Hi @Gaurav_Kumar2

following regex can help
use asign var = System.Text.RegularExpressions.Regex.Replace(VariableStr,"[([a-z A-Z \ *?)]","").ToString.

Thanks

what was that PoLine @balu because its showing error that its not declared

@Gaurav_Kumar2

its a str variable you can replace it with your string variable.

Thanks

@balu still am getting the same value.

Try these : [(a-z A-Z \\*?)]

Hope it works.

1 Like

@balu Thanks its working fine now