I want to find the character at a particular position of a very large string. However i am unable to use charAt()
method because the range exceeds that of int.
In Java, Strings are backed by a character array. The theoretical size of an array is limited by the maximum value of int
, so it's impossible to have a String with over 231-1 characters to begin with.
To overcome this issue you can create a string class of your own that uses multiple arrays or strings as storage.