Strings are concatenated with multiple strings.
There are 2 types of swift strings: string and NSString
The type of string is just string, in fact string is a struct
You can assign values directly, or you can create them through the constructor of the struct
Let Emptystring=string ()
By using let and VAR declaration variables for strings to implement immutable strings and mutable strings, the Let-declared string is immutable, VAR is variable
Comparison of strings:
1, size comparison;>,<
2. Equal comparison
Unlike comparison sizes, String and character types use = = and = comparisons, but cannot use the = = and!== operators
NSString can use = = = and!==
3, prefix and suffix comparison
(1) The string Hassuffix () method to determine the suffix;
Doc.hassuffix (". docx");
Doc is a string type
(2) Hasprefix of Strings ("Java")
Lowercasedoc.hasprefix ("Java")
Lowercasedoc is a String type
This article is from the "Ordinary Road" blog, please be sure to keep this source http://linjohn.blog.51cto.com/1026193/1619428
Swif creating string and string comparisons