WEB DEVELOPER SITE
PHP7
 

Java String replace() Method



This method Returns the character at the specified index


Syntax

Here is the syntax of this method โˆ’

public char charAt(int index)

Parameters

Here is the detail of parameters โˆ’

  • index โˆ’ Index of the character to be returned.

Return Value

  • This method returns a char at the specified index.

Example


public class Test {

   public static void main(String args[]) {
      String s = "Strings are immutable";
      char result = s.charAt(9);
      System.out.println(result);
   }
}

Run example ยป