About 18,700,000 results
Open links in new tab
  1. Java String length() Method - GeeksforGeeks

    Dec 23, 2024 · The length() method returns the number of characters present in the string. Suitable for string objects but not for arrays. Can also be used for StringBuilder and …

  2. Java String length() Method - W3Schools

    The length() method returns the length of a specified string. Note: The length of an empty string is 0.

  3. How to correctly compute the length of a String in Java?

    To get the size (in bytes) of a String in a specific encoding (i.e. charset) use str.getBytes(charset).length 2. To deal with locale-specific issues, you can use Normalizer to …

  4. How to Find Length of String Java | Effective Methods

    Jun 27, 2024 · The simplest way to find the length of a string in Java is to use the length() method of the String class, int len = str.length(); This method returns the number of characters in the …

  5. How do I find the Java String length? - TheServerSide

    Jun 9, 2022 · Follow these steps to find the length of a String in Java: Declare a variable of type String; Initialize the String variable to a non-null value; Call the Java String length() method; …

  6. How to find the length of a string in Java - Educative

    To calculate the length of a string in Java, you can use an inbuilt length() method of the Java string class. In Java, strings are objects created using the string class and the length() method …

  7. Java String length() - Programiz

    In this tutorial, you will learn about the Java String length () method with the help of examples.

  8. 4 Methods To Find Java String Length() | Str Length - Java

    Apr 15, 2025 · str length in Java – Using Standard Method. To find the length to string, we first taken in a string input in the code itself. This string input is converted to a character array so …

  9. Java String length() Method With Examples - Software Testing …

    Apr 1, 2025 · Java has an inbuilt method called length() to find the number of characters of any String. Syntax: The syntax is given as. int length(); where length() is a method to find the …

  10. 5 ways to find length of String in Java - Example Tutorial

    Apr 24, 2023 · In this article, we are going to look at some unorthodox approaches of finding String length in Java, all of these don't use the built-in length () method but make use of Java …

  11. Some results have been removed