
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Labels:
-
Other Contact Center
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
