Not really sure whether the question is exactly correct but I have a 'non printing' character in a string. If I look at the string in EXCEL I determine the character has a numeric equivalent of 160 (code(mychar)).
Using 160 doesn't appear to work in c# (Visual studio)
Equally statements like don't appear to isolate the character
I have managed to isolate the character into a single character by taking the first character of a string when I know the position.
If I then try to 'cast' to an integer I get a value of 65533. So now work backwards and eventual success with the following and see the '^' character in my string.
but.... what is this code and why does Regex not pick it out as whitespace ?
Using 160 doesn't appear to work in c# (Visual studio)
Equally statements like don't appear to isolate the character
C#:
Regex.Replace(line, @"\s+", "^");
line = Regex.Replace(line, @"\s+", "^");
Regex.Replace(line, @"\p{Z}", "^");
line = Regex.Replace(line, @"\p{Z}", "^");
I have managed to isolate the character into a single character by taking the first character of a string when I know the position.
If I then try to 'cast' to an integer I get a value of 65533. So now work backwards and eventual success with the following and see the '^' character in my string.
C#:
char mychar = (char)65533;
line = line.Replace(mychar, '^');
but.... what is this code and why does Regex not pick it out as whitespace ?
Last edited: