remove character from string javascript

The idea is to create a new string instead. Remove the first character from a string using Shift. Method 3: Using replace() method: The string.replace() function is an inbuilt function in JavaScript which is used to replace a part of the given string with some other string or a regular expression. Get rid of the ^ and $. function removeChar(s, c) { Here is a slice from the file : DATE:20091201T220000 SUMMARY:Dad's birthday the field I want to extract is "Summary". I am so close to getting this, but it just isn't right. Remove all occurrences of a character in a string; Remove characters from the first string which are present in the second string; Javascript