ARABIC_PUNCTUATION = ':"؟!؛،,.؍, '
def remove_arabic_punctuations(text : str) -> str:
'''
text : ", أَهْلًا وسَهْلًا Hello 212"
output :
---> " أَهْلًا وسَهْلًا Hello 212"
'''
chars = [char for char in text if (char not in ARABIC_PUNCTUATION)]
output = ''.join(chars)
return output
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter