Check if character in character set?

Hi,

 

How do I check to see if a Character is in a Character Set?

 

In Objective-C, I could write:

 

[[NSCharacterSet lowercaseLetterCharacterSet] characterIsMember:c]

 

Where “c” is a variable of type char.

 

In Swift, I tried to write:

 

CharacterSet.lowercaseLetters.contains(c)

 

Where “c” is of type Character, but I received an error saying that the function was expecting a parameter of type “Unicode.Scalar”.

 

Thanks,

Frank

Powered by WPeMatico

About

You may also like...

Comments are closed.