xxxxxxxxxx
node app.js
Original String: AppDividend
After character removed: Appividend
xxxxxxxxxx
// app.js
str = 'Hello cy Adele';
newStr = str.replace('c', '');
console.log('Original String: ', str);
console.log('After character removed: ', newStr);
xxxxxxxxxx
// app.js
str = 'AppDividend';
console.log('Original String:', str);
newStr = str.substr(1, str.length);
console.log('After removing the first character:', newStr);
xxxxxxxxxx
node app.js
Original String: Hello cy Adele
After character removed: Hello y Adele
xxxxxxxxxx
// app.js
str = 'AppDividend';
console.log('Original String: ', str);
newStr = str.replace(/D/g, '');
console.log('After character removed: ', newStr);
xxxxxxxxxx
// app.js
str = 'AppDividend';
console.log('Original String: ', str);
removeFirstChar = str.slice(1);
console.log('Removing the first character', removeFirstChar);
removeLastChar = str.slice(0, str.length - 1);
console.log('Removing the last character: ', removeLastChar);
xxxxxxxxxx
Original String: AppDividend
Removing the first character ppDividend
Removing the last character: AppDividen
xxxxxxxxxx
node app.js
Original String: AppDividend
After removing the first character: ppDividend