Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function stringToCodePointsArray(inStr) {
- var outArr = [];
- for (const symbol of inStr) {
- var point = symbol.codePointAt(0);
- outArr.push(point);
- // if (point !== 2028 && point !== 2029) {
- // outArr.push(point);
- // }
- }
- return outArr;
- }
- function codePointsToString(points) {
- var outStr = '';
- for (const point of points) {
- outStr = outStr + String.fromCodePoint(point);
- }
- return outStr;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement