Answers for "string get last from split java"

3

remoce last character froma java string

str = str.substring(0, str.length() - 1);
Posted by: Guest on December-15-2020
1

split and get last

Use rev command altogether with cut command as follows:
echo "a1 a2 a3 a4 a5" | rev | cut -d ' ' -f '1' | rev
#rev reverses string, then you cut from 2th field to end and reverse back
Posted by: Guest on November-10-2020

Code answers related to "string get last from split java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language