Birla Murugesan wrote:
Without iterating the array,Is there is any other way to do it.
Rob Prime wrote:Simply put, no. Whatever solution you use, in the end you will still need to change each separate string element into a long.
A more complicated answer ... Maybe. You already iterated once through the string, in order to split it into an array. Technically, there is a way to do without iterating through the array -- you can skip generating the array in the first place.
Instead of using split(), you can use find(), to get each "long" string element, in order to convert to a long -- in one pass.
Now, of course, whether this saves any time, is unclear.
Henry