(String value)
| 143 | } |
| 144 | |
| 145 | public static String trimString(String value) { |
| 146 | int len = value.length(); |
| 147 | int st = 0; |
| 148 | char[] val = value.toCharArray(); |
| 149 | |
| 150 | while ((st < len) && (isWhitespace(val[st]))) { |
| 151 | st++; |
| 152 | } |
| 153 | while ((st < len) && (isWhitespace(val[len - 1]))) { |
| 154 | len--; |
| 155 | } |
| 156 | |
| 157 | String result = null; |
| 158 | |
| 159 | if ( st > 0 || len < value.length() ) { |
| 160 | result = value.substring(st,len); |
| 161 | } else { |
| 162 | result = value; |
| 163 | } |
| 164 | return result; |
| 165 | } |
| 166 | |
| 167 | public static String trimNumericString(String value) { |
| 168 | char[] val = value.toCharArray(); |
no test coverage detected