Py In My Eye
Python 3, Tkinter, PyQt4, snippets, etc.
Page List
(Move to ...)
File: demopanels.py
▼
Monday, April 30, 2012
Find unique characters in a string
An example of finding unique characters in a string using
set
and
re
testStr = 'AAA 7 BBBB C 1 DDD d Y ZZ 3'
''.join( set(re.findall(r'[a-zA-Z]',testStr)) )
Output:
'ACBDYZd'
‹
›
Home
View web version