08-09-2013 12:54 PM - edited 03-14-2019 12:13 PM
Hi,
How can i find the lenght of a string array, i have used length method to calculate length of single string value,e.g
String value = "test"
int length = value.length()
Now i want to calculate length of a string array.e.g
String csv_values = "test,by,random"
String[] str = csv_values.split(",")
int lenght = str.length()
As you can see i want to calculate total number of entries in an array after i split it dynamically.
Currently it is giving me exception, "Unable to parse exception; Undefined method: length for class: [Ljava.lang.String]"
Thanks
Solved! Go to Solution.
08-09-2013 06:09 PM
This is a tricky one. An Array has a length property, unlike a String which has a length method.
So...
int length = str.length
Anthony Holloway
Please use the star ratings to help drive great content to the top of searches.
08-09-2013 06:09 PM
This is a tricky one. An Array has a length property, unlike a String which has a length method.
So...
int length = str.length
Anthony Holloway
Please use the star ratings to help drive great content to the top of searches.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide