Finding the length of a string - Java Language Basics

Java examples for Language Basics:String

Description

Finding the length of a string

Demo Code

public class Main {
  public static void main(String[] args) {
    String s = "this is a test.";
    int len = s.length();

    System.out.println(len);//from  ww  w.java2  s  .  co  m
  }

}

Related Tutorials