How To Get The Last Character Of The String

[Solved] How To Get The Last Character Of The String | Go - Code Explorer | yomemimo.com
Question : check last character of string java

Answered by : fierce-fly-azid61sn3bfv

String str = "India";
System.out.println("last char = " + str.charAt(str.length() - 1));

Source : https://stackoverflow.com/questions/5163785/how-do-i-get-the-last-character-of-a-string | Last Update : Mon, 30 Mar 20

Question : java get last char of string

Answered by : famous-flamingo-n3yzo956wqkc

public class Test { public static void main(String args[]) { String string = args[0]; System.out.println("last character: " + string.substring(string.length() - 1)); }
}

Source : https://stackoverflow.com/questions/5163785/how-do-i-get-the-last-character-of-a-string | Last Update : Mon, 02 Mar 20

Question : last char in string java

Answered by : careful-cockroach-550u9q9i0xke

public class Test { public static void main(String args[]) { String string = args[0]; System.out.println("last character: " + string.substring(string.length() - 1)); }
}

Source : https://stackoverflow.com/questions/5163785/how-do-i-get-the-last-character-of-a-string | Last Update : Thu, 22 Oct 20

Question : get last character from string

Answered by : cody-cooper

str.slice(-1);

Source : https://stackoverflow.com/questions/3884632/how-to-get-the-last-character-of-a-string | Last Update : Tue, 13 Sep 22

Answers related to how to get the last character of the string

Code Explorer Popular Question For Go