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 :: putting scanner into an array 
Java :: write a name and convert it to an array 
Java :: in place transpose in a matrix in java 
Java :: calling method in java 
Java :: parse string to int java 
Java :: java go troght loop object 
Java :: vscode java.home path 
Java :: float maximum value java 
Java :: input char java 
Java :: swing setbounds 
Java :: association in java 
Java :: Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.android.sdklib.repositoryv2.AndroidSdkHandler 
Java :: view binding in recyclerview adapter android java 
Java :: Problem adding rectangle in javaFX 
Java :: permission foreground_service 
Java :: java print 2d char array 
Java :: hello world in different programming languages 
Java :: java numbers 
Java :: java stream distinct by object atribute 
Java :: java random between two strings 
Java :: convert arraylist to csv file java 
Java :: java print 
Java :: java date format with timezone 
Java :: validate date java 
Java :: string tokenizer java 
Java :: compare two character alphabetically java 
Java :: tic tac toe in java 
Java :: arrays.aslist 
Java :: java calendar add minutes 
Java :: arraylist reverse in java 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =