Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

check last character of string java

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

java get last char of string

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

get last character from string

str.slice(-1);
Comment

last char in string java

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

PREVIOUS NEXT
Code Example
Java :: java for each loop 
Java :: Array list deep copy 
Java :: code for checking android build version 
Java :: isanagram java 
Java :: reverse int array java 
Java :: count occurrences of character in string java 8 
Java :: java array initialization 
Java :: creating a 2d arraylist in java 
Java :: java convert date to localdate 
Java :: java extract zip 
Java :: java get first day of the week 
Java :: javac clear 
Java :: java delete column from csv 
Java :: java instant from timestamp string 
Java :: java mockito any string import 
Java :: car class java 
Java :: string format java 
Java :: java string to integer 
Java :: java inline conditional 
Java :: string length in android studio java 
Java :: setbackground color hexadecimal android 
Java :: initialize hashmap with values 
Java :: method resolve file in java 
Java :: how to save a string to a text file 
Java :: insertion sort in java 
Java :: string array to stringbuilder array java 
Java :: how to count the number of occurrences of an element in a arraylist in java 
Java :: download File java from website 
Java :: java repeat method 
Java :: imageview.setbackground 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =