21A. Java Basics for Selenium - Java Strings - String Methods

Veröffentlicht am: 21 March 2019
auf dem Kanal: subbus tech
33
0

In this video we will see different string methods.
Different Methods of Strings:
Length of a string – length()
Getting the index of character or a substring – indexOf(Character or substring)
Getting the character at a particular position – charAt(index)
Checking if a string contains a substring – contains()
Checking if a string ends with something – endsWith()
Replacing substrings in a string – Replace, ReplaceAll, ReplaceFirst
Converting a string to lower case – toLowerCase()
Converting a string to Upper Case – toUpperCase()
Converting a String to an Integer:
To convert a string to an integer it should be a number string.
Integer.parseInt(string);
NumberFormatException:
If you try to convert a non number string to an integer, you will get this exception.
Substrings in Java:
In java you can get the substring of a string using substring() method.
If you pass only starting index for this method, you get a substring starting from the index you provided till the end of the string.
If you pass the starting index and ending index for this method, you get a substring from the starting index to the ending index not including the ending index.


Auf dieser Seite können Sie das Online-Video 21A. Java Basics for Selenium - Java Strings - String Methods mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer subbus tech 21 March 2019 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 33 Mal angesehen und es wurde von 0 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!