Non breaking space in XAML vs. code Non breaking space in XAML vs. code wpf wpf

Non breaking space in XAML vs. code


In code the syntax for escaping Unicode chars is different than in XAML:

XAML:  C#:   \x00A0

So this should have worked in code:

return value.ToString().Replace(" ", "\xA0");


Have you tried return value.ToString().Replace(' ', System.Convert.ToChar(160)); ?


The reason Char is working and string is not - is that the string is escaped when rendered.