You should be able to achieve this via the below: Assign - YourString = New String(YourString.AsEnumerable().Where(Function (character) Char.IsDigit(character)).ToArray)
This will remove any non-numeric values.
With that said, it will throw an exception if none exist, so it may be worth using: If - YourString.AsEnumerable().Any(Function (character) Char.IsDigit(character)) Then Assign - YourString = New String(YourString.AsEnumerable().Where(Function (character) Char.IsDigit(character)).ToArray) Else Assign - YourString = String.Empty
Please let me know if you have any questions.
Thanks once again for your support,
Josh
@ppr thanks for the reply,
If i have same value(ILD123456) in a variable like “ILDFromWeb” and wanted to replace the “char” value
how to write that
Regex.Replace(ILDFromWeb,“\D+”) ?