About 30,000,000 results
Open links in new tab
  1. Java String length() Method - W3Schools

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

  2. 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 …

  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. How to Get the Length of a String in Java - onlyxcodes

    Jul 2, 2024 · The total amount of characters in a string, including spaces and special characters, is referred to as its length. Java offers a simple way to accomplish this using the String class. …

  6. 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. …

  7. 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 …

  8. 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 …

  9. 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. …

  10. Java String length() example - Java Guides

    In this guide, you will learn about the String length () method in Java programming and how to use it with an example. 1. String length () Method Overview. The length () method of Java's String …

  11. Some results have been removed
Refresh