function removespace(str) { return str.replace(/(^s*)|(s*$)/g, ""); } function getLength(str) { var DOUBLEBYTE_CHAR_PATTERN = /[^x00-xff]/g; if (str == null) return 0; return str.replace(DOUBLEBYTE_CHAR_PATTERN, "aa").length; }
function removespace(str) { return str.replace(/(^s*)|(s*$)/g, ""); } function getLength(str) { var DOUBLEBYTE_CHAR_PATTERN = /[^x00-xff]/g; if (str == null) return 0; return str.replace(DOUBLEBYTE_CHAR_PATTERN, "aa").length; }