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

Publicado el: 21 March 2019
en el canal de: 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.


En esta página del sitio puede ver el video en línea 21A. Java Basics for Selenium - Java Strings - String Methods de Duración hora minuto segunda en buena calidad , que subió el usuario subbus tech 21 March 2019, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 33 veces y le gustó 0 a los espectadores. Disfruta viendo!