Answers for "how to identify special character in python string"

4

check if special character in string python

string = "Daneshwar$/?$Daneshwar"
regex = re.compile('[@_!#$%^&*()<>?/|}{~:]')
if(regex.search(string) == None):
	print("special is absent")
else:
	print("present")
Posted by: Guest on June-20-2021
2

python print show special characters

a = "HellotWorldnHello World"
print(repr(a))
# 'HellotWorldnHello World'
Posted by: Guest on August-05-2020

Code answers related to "how to identify special character in python string"

Python Answers by Framework

Browse Popular Code Answers by Language