Get the string associated with an index. @webref jsonarray:method @brief Gets the String value associated with an index @param index must be between 0 and length() - 1 @return A string value. @throws RuntimeException If there is no string value for the index. @see JSONArray#getInt(int) @see JS
(int index)
| 285 | * @see JSONArray#getBoolean(int) |
| 286 | */ |
| 287 | public String getString(int index) { |
| 288 | Object object = this.get(index); |
| 289 | if (object instanceof String) { |
| 290 | return (String)object; |
| 291 | } |
| 292 | throw new RuntimeException("JSONArray[" + index + "] not a string."); |
| 293 | } |
| 294 | |
| 295 | |
| 296 | /** |
no test coverage detected