Answers for "what is the index of the last character in a string"

8

python index of last occurrence in string

>>> s = 'hello'
>>> s.rfind('l')
3
Posted by: Guest on October-02-2020
5

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)); 
    }
}
Posted by: Guest on October-15-2020

Code answers related to "what is the index of the last character in a string"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language