length of string java
public class Sample_String {
public static void main(String[] args) {
//declare the String as an object S1 S2
String S1 = "Hello Java String Method";
String S2 = "RockStar";
//length() method of String returns the length of a String S1.
int length = S1.length();
System.out.println("Length of a String is: " + length);
//8 Length of a String RockStar
System.out.println("Length of a String is: " + S2.length());
}
}
String data = "Hello, World!";
int nameLength = data.length(); // 13String data = "Hello, World!";
int nameLength = data.length();
Also in Java:
- java nextpermutation
- how to play an audio in java
- demo java file
- read lines of file randomly java
- write file from a specific location in java
- java string to character stream
- processing sound library
- java insert into arraylist
- java methods
- java jaxb unmarshall xml to map
- jsonobject to java object
- how to remove components from a JFRame java
- islowercase java
- java type casting
- java swing button on click
- java 8 stream group by example
- android how to know when snackbar is done
- how to ask user for his location in android
- java hashmap set value
- how to declare array java
- best companies to workk in
- numberformatexception
- how to create a draw Rectangle in java
- how to use lambda in java