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));
}
}String str = "India";
System.out.println("last char = " + str.charAt(str.length() - 1));
Also in Java:
- how do you make a method that returns an array java
- Create ArrayList from array java
- java replace element in list
- take a value from keyboard java
- set color of text for jlabel
- java stream find specific element
- never gonna give you up
- java stream sort Collator
- count occurrences of character in string java 8
- java file download
- getindexrequest elasticsearch
- arraylist remove method java
- how to create an array with unique values
- android studio keep device awake
- leap year program in java
- spigot run command as console
- java string contains char
- print a list java
- what is a variable in java
- java identifier expected
- java remove non numbers from string
- int to binary java
- java how to get current date
- java initialize string array