Java StringBuilder length() methodLast Updated : 17 Mar 2025 The length() method of Java StringBuilder class returns the length (total characters) of this sequence. Syntax:Parameter:NA Returns:The length() method returns the total character count of this sequence. Exception:NA Compatibility Version:Java 1.5 and above Example 1Output: total character count of "javatpoint"= 10 total character count of "string l e ng th"= 16 total character count = 0 Example 2In this example, we are calculating the length of the string by taking input from a user. Output: enter your string value: hello this is a string total input character : 22 Next TopicJava threadlocal remove method |
We request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India