View RSS Feed

Recent Blogs Posts

  1. Getting Characters and Substrings by Index

    by , 04-26-2012 at 07:34 PM
    Character can be obtained at one particular index, within a string, by charAt() accessor methodís invoking. First character index is 0 however last character index is length()-1. This given example shows the code which obtains the character, at index 9 present in string.
    String anotherPalindrome = "Niagara. O roar again!";

    char aChar = anotherPalindrome.charAt(9);

    Indices start with 0 therefore the characters which are present at the index 9 are 'O'. ...