(String key)
| 153 | } |
| 154 | |
| 155 | public static String trimKey(String key) { |
| 156 | if (key==null) |
| 157 | return key; |
| 158 | int index = key.indexOf(" "); |
| 159 | if (index>-1) |
| 160 | key = key.substring(0,index); |
| 161 | index = key.indexOf(":"); |
| 162 | if (index>-1) |
| 163 | key = key.substring(0,index); |
| 164 | key = key.toLowerCase(Locale.US); |
| 165 | return key; |
| 166 | } |
| 167 | |
| 168 | /** Evaluates 'code' and returns the output, or any error, |
| 169 | * as a String (e.g., Macro.eval("2+2") returns "4"). |
no test coverage detected