(str)
| 267 | } |
| 268 | |
| 269 | function trim(str) { |
| 270 | if (str == null) |
| 271 | return null; |
| 272 | |
| 273 | var startingIndex = 0; |
| 274 | var endingIndex = str.length-1; |
| 275 | |
| 276 | while (str.substring(startingIndex, startingIndex+1) == ' ') |
| 277 | startingIndex++; |
| 278 | |
| 279 | while (str.substring(endingIndex, endingIndex+1) == ' ') |
| 280 | endingIndex--; |
| 281 | |
| 282 | if (endingIndex < startingIndex) |
| 283 | return ''; |
| 284 | |
| 285 | return str.substring(startingIndex, endingIndex+1); |
| 286 | } |
| 287 | |
| 288 | function isBlank(str) { |
| 289 | return trim(str) == ''; |