[swift-users] Why there's no Character literals?
owenzx at gmail.com
Sun Jul 10 20:40:17 CDT 2016
Of course not. Struct Set is commonly known.
let foo:Set = [1,2,3,4]
let bar:Set<Int> = [1,2,3,4]
If you do not specify them as Sets, foo and bar will be Arrays.
On Thu, Jul 7, 2016 at 5:35 PM, 王 黎明 <swift-users at swift.org> wrote:
> In Swift, we must specify the type for Character variables(because there’s
> no Character literals):
> let eol: Character = “\n”
> it's not a big problem, but, Is it the unique case that can’t use type
> swift-users mailing list
> swift-users at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-users