Remove an element from the specified index. @webref stringlist:method @webBrief Remove an element from the specified index
(int index)
| 185 | * @webBrief Remove an element from the specified index |
| 186 | */ |
| 187 | public String remove(int index) { |
| 188 | if (index < 0 || index >= count) { |
| 189 | throw new ArrayIndexOutOfBoundsException(index); |
| 190 | } |
| 191 | String entry = data[index]; |
| 192 | for (int i = index; i < count-1; i++) { |
| 193 | data[i] = data[i+1]; |
| 194 | } |
| 195 | count--; |
| 196 | return entry; |
| 197 | } |
| 198 | |
| 199 | |
| 200 | // Remove the first instance of a particular value and return its index. |
no outgoing calls
no test coverage detected