|
|
|
|
|
by hinkley
2723 days ago
|
|
This seems specious to me. The only way to get an invalid index in a string in any language is that you either have an array index arithmetic error or you are blindly operating on a string you haven't validated. If you want all the data after a : character, you slice on the index of the :. The character after it is going to be the beginning of a UTF-8 character. You do not under any circumstances guess that the colon is at position 6 in the string. That's not safe. Why are you going cowboy in a language that is so obsessed with safety? |
|