EN
TypeScript - no-break / non-breaking space in string
0 points
In this very short article, we are going to look at how to insert a no-break (non-breaking) space character to string in TypeScript.
Quick solution: use the following \u00A0
character code.
xxxxxxxxxx
1
const text: string = 'a \u00A0\u00A0\u00A0 b'; // U+00A0
2
3
console.log(text); // a b
Output:
xxxxxxxxxx
1
a b