How to get length of string in Java?

Ads
 

How to get length of string in Java?

What is the method of String for getting the length?

How to get length of string in Java?

Tell me code fast.

Thanks

View Answers

September 12, 2014 at 5:51 AM

Hi,

You may use the following code:

String str= "Good Tutorials";
int length = str.length();

You have to use the str.length() to get the length of a String object.

Thanks

Ads









Related Tutorials/Questions & Answers:
How to get length of string in Java?
String length example
Advertisements
PHP String Length
difference between java5 and java6 - Java Beginners
Java2
String length without using length() method in java
how to get string between two characters
about java1
PHP Get Array Length
Mysql String Length
Mysql String Length
C String length
how to get string after first occurence of alphanumeric char in java?
Java : Length of String
How can I get query string values in JavaScript?
length() Method In Java
generating unique combinations of length of x in a string of length l
Javah
String Length
PHP get character from String
String length property example
Get Length of Array
Get Length of Array
javaa swings - IDE Questions
Javap Tool application
About Java2
Use of string-length() function in XPath
Java get Stack Trace as String
Use of <fn:length(String)> Tag of JSTL
how to get date format in string from date object containing real date in java
how to get date format in string from date object containing real date in java

Ads