Remove Last Character From a String in Apex

String str1 = 'Biswajeet';
String str2 = str1.removeEnd('jeet');
system.debug('Output-' + str2);

USER_DEBUG [3]|DEBUG|Output-Biswa