1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 1 1 3 3 1 | define(['../lang/toString'], function(toString){ /** * Remove non-printable ASCII chars */ function removeNonASCII(str){ str = toString(str); // Matches non-printable ASCII chars - // http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters return str.replace(/[^\x20-\x7E]/g, ''); } return removeNonASCII; }); |