import java.util.*;
import java.lang.*;
public class Main
{
{
String s1
= "Remove Last CharacterY"; String s2
= "Remove Last Character2"; System.
out.
println("After removing s1==" + removeLastChar
(s1
) + "=="); System.
out.
println("After removing s2==" + removeLastChar
(s2
) + "=="); }
return str.substring(0,str.length()-1);
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CiAKcHVibGljIGNsYXNzIE1haW4KewogICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCiAgICB7CiAgICAgICAgICAgICAgICBTdHJpbmcgczEgPSAiUmVtb3ZlIExhc3QgQ2hhcmFjdGVyWSI7CiAgICAgICAgU3RyaW5nIHMyID0gIlJlbW92ZSBMYXN0IENoYXJhY3RlcjIiOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiQWZ0ZXIgcmVtb3ZpbmcgczE9PSIgKyByZW1vdmVMYXN0Q2hhcihzMSkgKyAiPT0iKTsKICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oIkFmdGVyIHJlbW92aW5nIHMyPT0iICsgcmVtb3ZlTGFzdENoYXIoczIpICsgIj09Iik7CiAgICAgICAgfQogICAgCiAgICBwcml2YXRlIHN0YXRpYyBTdHJpbmcgcmVtb3ZlTGFzdENoYXIoU3RyaW5nIHN0cikgewogICAgICAgIHJldHVybiBzdHIuc3Vic3RyaW5nKDAsc3RyLmxlbmd0aCgpLTEpOwogICAgfQp9