Rashmi
--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To view this discussion on the web visit https://groups.google.com/d/msg/webdriver/-/2ldlxff5U2kJ.
To post to this group, send email to webd...@googlegroups.com.
To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
This is basic Java, nothing to do with Selenium, off the top of my head the answer is something like this:
//Take the original string
String sentence = "Displaying 1- 20 of 50"
//Split it into an array based upon whitespace
String[] words = sentence.split(" ")
//Get the last element in the array (this should be 50).
String result = words[words.length - 1]
The reason for using length -1 is that the first element in an array is 0 not 1.