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
- Character replacement after removing duplicates from a string
- Print reverse string after removing vowels
- Modify string by removing vowels in between two consonants
- Ways of transforming one string to other by removing 0 or more characters
- Balance a string after removing extra brackets
- Lexicographically smallest string formed by removing at most one character
- Reduce the string by removing K consecutive identical characters
- Minimize the length of string by removing occurrence of only one character
- 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
- Check if a + b = c is valid after removing all zeroes from a, b and c
- Subsequence queries after removing substrings
Improved By : 29AjayKumar