This functionality is not currently available in Javascript. However, tou can add this function to perform trimming in the strings. Trimming is useful in checking for empty spaces.
function RTrim(str){ var whitespace = new String("
"); var s = new String(str); if (whitespace.indexOf(s.charAt(s.length-1)) != -1) { var n = s.length - 1; while (n >= 0 && whitespace.indexOf(s.charAt(n)) != -1){ n--; s = s.substring(0, n+1); } } return s;}function LTrim(str){ var whitespace = new String("
"); var s = new String(str); if (whitespace.indexOf(s.charAt(0)) != -1) { var pos=0, m = s.length; while (pos < m && whitespace.indexOf(s.charAt(pos)) != -1){ pos++; s = s.substring(pos, m); } } return s;}function Trim(s){ if (s=="undefined") return ""; else{ var tmp; tmp = RTrim(LTrim(s)); return tmp; }}