Unvisible characters in a string

Hi,
I’m getting a text from some website ,
For example:
“2312.66”
Then I’m trying to convert it to decimal, but I’m getting an error: “string was not in a correct format”.
Then I realized that the string Length that I get is ‘9’, but obviously should be ‘7’ as you can see.
I asumed that this is the issue, but I’m not sure how to fix since “remove” / “replace of empty characters (”", " ") didn’t help.

Thanks :blush:

Hi,

There might be zero width space etc. For now, can you try the following expression?

System.Text.RegularExpressions.Regex.Replace(yourString,"[^.\d]","")

Regards,

It works!
Thank u so much :+1::+1::+1:

1 Like

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