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

    Dec 23, 2024 · In this article, we will see how to find the length of a string using the String length () method. Example: Important Points: The length () method returns the number of characters …

  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 number of Unicode codepoints in a String use str.codePointCount(0, str.length()) -- see the javadoc. To get the size (in bytes) of a String in a specific encoding (i.e. charset) use …

  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. Java String.length() Method - Tpoint Tech

    The Java String class's length() function yields the total number of characters (or Unicode code units) in the string. The length of a string may be easily and quickly determined with this …

  6. 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. where length () is a method to find the number of …

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

    Jun 9, 2022 · Follow these steps to find the length of a String in Java: The Java String class contains a length () method that returns the total number of characters a given String contains. …

  8. Java String length() Method with examples - BeginnersBook

    Sep 11, 2022 · Java String length () method is used to find out the length of a String. This method counts the number of characters in a String including the white spaces and returns the count. …

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

    Apr 15, 2025 · Java program to calculate length of string – In this article, we will discuss the various methods to calculate the length of a string, str length in Java programming. String …

  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
Refresh