Gets the String value associated with the specified index. @webref jsonarray:method @webBrief 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 J
(int index)
| 291 | * @see JSONArray#getBoolean(int) |
| 292 | */ |
| 293 | public String getString(int index) { |
| 294 | Object object = this.get(index); |
| 295 | if (object instanceof String) { |
| 296 | return (String)object; |
| 297 | } |
| 298 | throw new RuntimeException("JSONArray[" + index + "] not a string."); |
| 299 | } |
| 300 | |
| 301 | |
| 302 | /** |
no test coverage detected