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 firstname.lastname@example.org. 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.
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Removing string that is an anagram of an earlier string
- Print string after removing all (“10” or “01”) from the binary string
- Removing spaces from a string using Stringstream
- Ways of transforming one string to other by removing 0 or more characters
- Modify string by removing vowels in between two consonants
- 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
- Print reverse string after removing vowels
- Minimize the length of string by removing occurrence of only one character
- Lexicographically smallest string formed by removing at most one character
- Reduce the string by removing K consecutive identical characters
- Check if string is palindrome after removing all consecutive duplicates
- 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
- Removing elements between the two zeros
- Check whether a + b = c or not after removing all zeroes from a,b and c
- Subsequence queries after removing substrings
- Empty an Array by removing maximum of K value from it
Improved By : 29AjayKumar