Given a string, remove the punctuation from the string if the given character is a punctuation character as classified by the current C locale. The default C locale classifies these characters as punctuation:
Input : %welcome' to @geeksforgeek<s Output : welcome to geeksforgeeks Input : Hello!!!, he said ---and went. Output : Hello he said and went
A loop is designed that goes through a list composed of the characters and punctuations of that string, removes the punctuation and then joins them.
Welcome to GeeksforGeeks
This article is contributed by Pramod Kumar. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Removing spaces from a string using Stringstream
- Ways of transforming one string to other by removing 0 or more characters
- Character replacement after removing duplicates from a string
- Balance a string after removing extra brackets
- Find the resultant String after replacing X with Y and removing Z
- Modify string by removing vowels in between two consonants
- Print reverse string after removing vowels
- Minimize the length of string by removing occurrence of only one character
- Reduce the string by removing K consecutive identical characters
- Lexicographically smallest string formed by removing at most one character
- Check if string remains palindrome after removing given number of characters
- Minimum sum of squares of character counts in a given string after removing k characters
- Find longest palindrome formed by removing or shuffling chars from string
- Check whether a + b = c or not after removing all zeroes from a,b and c
- Removing elements between the two zeros
Improved By : 29AjayKumar