¡GoConqr estrena diseño! Cuéntanos qué te parece.

Diapositivas

Useful String Methods

Shannon Anderson-Rush Inglés 8 diapositivas 2.388 visitas

Diapositivas del conjunto (8)

  1. int length()

    • This method is used to find the length of a String. The int indicates that the length method will store and return an integer.
  2. String substring(int from, int to)

    • This method is used to create a substring of the original string. The substring will start at index from and end at to -1 (the first index position is inclusive while the stopping index position is exclusive). You must use the given parameters in order to know what substring is created.
  3. String substring(int from)

    • This method returns a substring starting at index from and continuing to the length( ) of the original String.
  4. int indexOf(String str)

    • This method will return an integer stating at the index position of the first occurrence of str located within the string.
  5. char charAt(int index)

    • This method will return the character located at the specified index position.
  6. boolean equalsIgnoreCase (String str)

    • This method compares two strings while ignoring the case. It returns a true value if the two strings are identical regardless of case and false if they are not equal.
  7. String replace(char oldChar, char newChar)

    • This method will replace an existing character within a string with a new character.
  8. int compareTo(String other)

    • This method compares the first String with the String referenced by other. Comparing is like putting them in alphabetical order. The method does not actually order the two Strings, however, it will tell you which String would come first. It does this by returning a positive value if the first String comes after other, or a negative value if the first String comes before other. If the words are exactly the same, it will return a zero. When comparing Strings, uppercase comes before lowercase.

Información

Descripción
Diapositivas sobre Useful String Methods, creado por Shannon Anderson-Rush el 16/08/2019.
Creado por
Shannon Anderson-Rush · ago 2019
Actualizado
29 sep 2019
Visitas
2.388
Etiquetas
java
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?