JAVASCRIPT
how to remove selected characters from a string in javascript
// app.js
str = 'Hello cy Adele';
newStr = str.replace('c', '');
console.log('Original String: ', str);
console.log('After character removed: ', newStr);
how to remove selected characters from a string in javascript
// app.js
str = 'AppDividend';
console.log('Original String:', str);
newStr = str.substr(1, str.length);
console.log('After removing the first character:', newStr);
how to remove selected characters from a string in javascript
node app.js
Original String: Hello cy Adele
After character removed: Hello y Adele
how to remove selected characters from a string in javascript
// app.js
str = 'AppDividend';
console.log('Original String: ', str);
newStr = str.replace(/D/g, '');
console.log('After character removed: ', newStr);
how to remove selected characters from a string in javascript
node app.js
Original String: AppDividend
After character removed: Appividend
how to remove selected characters from a string in javascript
// 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);
how to remove selected characters from a string in javascript
Original String: AppDividend
Removing the first character ppDividend
Removing the last character: AppDividen
how to remove selected characters from a string in javascript
node app.js
Original String: AppDividend
After removing the first character: ppDividend