String example = "/abc/def/ghfj.doc";
System.out.println(example.substring(example.lastIndexOf("/") + 1));
More Related Contents:
- Need the words between the ” – ” ONLY string splitting [duplicate]
- Can you explain the output of the following source code?
- How to find nth occurrence of character in a string?
- In Java, how do I check if a string contains a substring (ignoring case)? [duplicate]
- How to replace case-insensitive literal substrings in Java
- Java – removing first character of a string
- How does Java store Strings and how does substring work internally? [closed]
- substring index range
- How to replace a substring of a string [duplicate]
- How do I get the last character of a string?
- Finding second occurrence of a substring in a string in Java
- When should we use intern method of String on String literals
- What makes reference comparison (==) work for some strings in Java?
- How do I trim a file extension from a String in Java?
- ArrayList initial capacity and IndexOutOfBoundsException [duplicate]
- How to convert String to long in Java?
- CharSequence VS String in Java?
- Easy way to remove accents from a Unicode string? [duplicate]
- How do I escape a string in Java?
- Remove end of line characters from Java string
- String Deduplication feature of Java 8
- Convert String to Uri
- How to remove single character from a String by index
- Simple way to sort strings in the (case sensitive) alphabetical order
- Java: how to initialize String[]?
- Comparing a string with the empty string (Java)
- Java Scanner class reading strings
- Quotation marks inside a string [duplicate]
- Java – How to visually center a specific string (not just a font) in a rectangle
- How can I print a string adding newlines in Java?