NSString
class NSString
class NSString
import Foundation
class NSObject
The root class of most Foundation class hierarchies.
protocol CVarArg
A type whose instances can be encoded, and appropriately passed, as elements of a C va_list
.
protocol Comparable : Equatable
A type that can be compared using the relational operators <
, <=
, >=
, and >
.
protocol Copyable
A type whose values can be implicitly or explicitly copied.
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Escapable
protocol ExpressibleByExtendedGraphemeClusterLiteral : ExpressibleByUnicodeScalarLiteral
A type that can be initialized with a string literal containing a single extended grapheme cluster.
protocol ExpressibleByStringLiteral : ExpressibleByExtendedGraphemeClusterLiteral
A type that can be initialized with a string literal.
protocol ExpressibleByUnicodeScalarLiteral
A type that can be initialized with a string literal containing a single Unicode scalar value.
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
protocol NSCoding
The NSCoding
protocol declares the two methods that a class must implement so that instances of that class can be encoded and decoded. This capability provides the basis for archiving (where objects and other structures are stored on disk) and distribution (where objects are copied to different address spaces).
protocol NSCopying
The NSCopying
protocol declares a method for providing functional copies of an object. The exact meaning of “copy” can vary from class to class, but a copy must be a functionally independent object with values identical to the original at the time the copy was made.
protocol NSMutableCopying
The NSMutableCopying
protocol declares a method for providing mutable copies of an object. Only classes that define an “immutable vs. mutable” distinction should adopt this protocol. Classes that don’t define such a distinction should adopt NSCopying
instead.
protocol NSObjectProtocol : AnyObject
The NSObjectProtocol
groups methods that are fundamental to all Foundation objects.
protocol NSSecureCoding : NSCoding
Conforming to the NSSecureCoding
protocol indicates that an object handles encoding and decoding instances of itself in a manner that is robust against object substitution attacks.
override convenience init()
convenience init?(bytes: UnsafeRawPointer, length len: Int, encoding: UInt)
convenience init?(bytesNoCopy bytes: UnsafeMutableRawPointer, length len: Int, encoding: UInt, freeWhenDone freeBuffer: Bool)
convenience init?(cString nullTerminatedCString: UnsafePointer<Int8>, encoding: UInt)
init(characters: UnsafePointer<unichar>, length: Int)
convenience init(charactersNoCopy characters: UnsafeMutablePointer<unichar>, length: Int, freeWhenDone freeBuffer: Bool)
required convenience init?(coder aDecoder: NSCoder)
convenience init(contentsOf url: URL, encoding enc: UInt) throws
convenience init(contentsOf url: URL, usedEncoding enc: UnsafeMutablePointer<UInt>?) throws
convenience init(contentsOfFile path: String, encoding enc: UInt) throws
convenience init(contentsOfFile path: String, usedEncoding enc: UnsafeMutablePointer<UInt>?) throws
convenience init?(data: Data, encoding: UInt)
required convenience init(extendedGraphemeClusterLiteral value: StaticString)
convenience init(format: NSString, _ args: any CVarArg...)
convenience init(format: String, arguments argList: CVaListPointer)
convenience init(format: String, locale: AnyObject?, arguments argList: CVaListPointer)
required convenience init(string aString: String)
required init(stringLiteral value: StaticString)
required convenience init(unicodeScalarLiteral value: StaticString)
convenience init?(utf8String nullTerminatedCString: UnsafePointer<Int8>)
static var supportsSecureCoding: Bool { get }
static func path(withComponents components: [String]) -> String
class var availableStringEncodings: UnsafePointer<UInt> { get }
class var defaultCStringEncoding: UInt { get }
class func localizedName(of encoding: UInt) -> String
var boolValue: Bool { get }
var capitalized: String { get }
var decomposedStringWithCanonicalMapping: String { get }
var decomposedStringWithCompatibilityMapping: String { get }
var deletingLastPathComponent: String { get }
var deletingPathExtension: String { get }
override var description: String { get }
var doubleValue: Double { get }
var expandingTildeInPath: String { get }
var fastestEncoding: UInt { get }
var fileSystemRepresentation: UnsafePointer<Int8> { get }
var floatValue: Float { get }
override var hash: Int { get }
var intValue: Int32 { get }
var integerValue: Int { get }
var isAbsolutePath: Bool { get }
var lastPathComponent: String { get }
var length: Int { get }
var localizedCapitalized: String { get }
var localizedLowercase: String { get }
var localizedUppercase: String { get }
var longLongValue: Int64 { get }
var lowercased: String { get }
var pathComponents: [String] { get }
var pathExtension: String { get }
var precomposedStringWithCanonicalMapping: String { get }
var precomposedStringWithCompatibilityMapping: String { get }
var removingPercentEncoding: String? { get }
var resolvingSymlinksInPath: String { get }
var smallestEncoding: UInt { get }
var standardizingPath: String { get }
var uppercased: String { get }
var utf8String: UnsafePointer<Int8>? { get }
static func < (lhs: NSString, rhs: NSString) -> Bool
func addingPercentEncoding(withAllowedCharacters allowedCharacters: CharacterSet) -> String?
func appending(_ aString: String) -> String
func appendingPathComponent(_ str: String) -> String
func appendingPathExtension(_ str: String) -> String?
func applyingTransform(_ transform: StringTransform, reverse: Bool) -> String?
func cString(using encoding: UInt) -> UnsafePointer<Int8>?
func canBeConverted(to encoding: UInt) -> Bool
func capitalized(with locale: Locale?) -> String
func caseInsensitiveCompare(_ string: String) -> ComparisonResult
func character(at index: Int) -> unichar
func commonPrefix(with str: String, options mask: NSString.CompareOptions = []) -> String
func compare(_ string: String) -> ComparisonResult
func compare(_ string: String, options mask: NSString.CompareOptions) -> ComparisonResult
func compare(_ string: String, options mask: NSString.CompareOptions, range compareRange: NSRange) -> ComparisonResult
func compare(_ string: String, options mask: NSString.CompareOptions, range compareRange: NSRange, locale: Any?) -> ComparisonResult
func completePath(into outputName: inout String?, caseSensitive flag: Bool, matchesInto outputArray: inout [String], filterTypes: [String]?) -> Int
func components(separatedBy separator: CharacterSet) -> [String]
func components(separatedBy separator: String) -> [String]
func contains(_ str: String) -> Bool
override func copy() -> Any
func copy(with zone: NSZone? = nil) -> Any
func data(using encoding: UInt) -> Data?
func data(using encoding: UInt, allowLossyConversion lossy: Bool = false) -> Data?
func encode(with aCoder: NSCoder)
func enumerateLines(_ block: (String, UnsafeMutablePointer<ObjCBool>) -> Void)
func enumerateSubstrings(in range: NSRange, options opts: NSString.EnumerationOptions = [], using block: (String?, NSRange, NSRange, UnsafeMutablePointer<ObjCBool>) -> Void)
func folding(options: NSString.CompareOptions = [], locale: Locale?) -> String
func getBytes(_ buffer: UnsafeMutableRawPointer?, maxLength maxBufferCount: Int, usedLength usedBufferCount: UnsafeMutablePointer<Int>?, encoding: UInt, options: NSString.EncodingConversionOptions = [], range: NSRange, remaining leftover: NSRangePointer?) -> Bool
func getCString(_ buffer: UnsafeMutablePointer<Int8>, maxLength maxBufferCount: Int, encoding: UInt) -> Bool
func getCharacters(_ buffer: UnsafeMutablePointer<unichar>, range: NSRange)
func getFileSystemRepresentation(_ cname: UnsafeMutablePointer<Int8>, maxLength max: Int) -> Bool
func getLineStart(_ startPtr: UnsafeMutablePointer<Int>?, end lineEndPtr: UnsafeMutablePointer<Int>?, contentsEnd contentsEndPtr: UnsafeMutablePointer<Int>?, for range: NSRange)
func getParagraphStart(_ startPtr: UnsafeMutablePointer<Int>?, end parEndPtr: UnsafeMutablePointer<Int>?, contentsEnd contentsEndPtr: UnsafeMutablePointer<Int>?, for range: NSRange)
func hasPrefix(_ str: String) -> Bool
func hasSuffix(_ str: String) -> Bool
override func isEqual(_ object: Any?) -> Bool
func isEqual(to aString: String) -> Bool
func lengthOfBytes(using enc: UInt) -> Int
func lineRange(for range: NSRange) -> NSRange
func localizedCaseInsensitiveCompare(_ string: String) -> ComparisonResult
func localizedCaseInsensitiveContains(_ str: String) -> Bool
func localizedCompare(_ string: String) -> ComparisonResult
func localizedStandardCompare(_ string: String) -> ComparisonResult
func localizedStandardContains(_ str: String) -> Bool
func localizedStandardRange(of str: String) -> NSRange
func lowercased(with locale: Locale?) -> String
func maximumLengthOfBytes(using enc: UInt) -> Int
override func mutableCopy() -> Any
func mutableCopy(with zone: NSZone? = nil) -> Any
func padding(toLength newLength: Int, withPad padString: String, startingAt padIndex: Int) -> String
func paragraphRange(for range: NSRange) -> NSRange
func range(of searchString: String) -> NSRange
func range(of searchString: String, options mask: NSString.CompareOptions = []) -> NSRange
func range(of searchString: String, options mask: NSString.CompareOptions = [], range searchRange: NSRange) -> NSRange
func range(of searchString: String, options mask: NSString.CompareOptions = [], range searchRange: NSRange, locale: Locale?) -> NSRange
func rangeOfCharacter(from searchSet: CharacterSet) -> NSRange
func rangeOfCharacter(from searchSet: CharacterSet, options mask: NSString.CompareOptions = []) -> NSRange
func rangeOfCharacter(from searchSet: CharacterSet, options mask: NSString.CompareOptions = [], range searchRange: NSRange) -> NSRange
func rangeOfComposedCharacterSequence(at index: Int) -> NSRange
func rangeOfComposedCharacterSequences(for range: NSRange) -> NSRange
func replacingCharacters(in range: NSRange, with replacement: String) -> String
func replacingOccurrences(of target: String, with replacement: String) -> String
func replacingOccurrences(of target: String, with replacement: String, options: NSString.CompareOptions = [], range searchRange: NSRange) -> String
func stringsByAppendingPaths(_ paths: [String]) -> [String]
func substring(from: Int) -> String
func substring(to: Int) -> String
func substring(with range: NSRange) -> String
func trimmingCharacters(in set: CharacterSet) -> String
func uppercased(with locale: Locale?) -> String
func write(to url: URL, atomically useAuxiliaryFile: Bool, encoding enc: UInt) throws
func write(toFile path: String, atomically useAuxiliaryFile: Bool, encoding enc: UInt) throws
struct EncodingConversionOptions
struct EnumerationOptions
typealias CompareOptions = String.CompareOptions
init(extendedGraphemeClusterLiteral value: Self.StringLiteralType)
init(unicodeScalarLiteral value: Self.ExtendedGraphemeClusterLiteralType)
static func ... (minimum: Self) -> PartialRangeFrom<Self>
Returns a partial range extending upward from a lower bound.
static func ... (maximum: Self) -> PartialRangeThrough<Self>
Returns a partial range up to, and including, its upper bound.
static func ... (minimum: Self, maximum: Self) -> ClosedRange<Self>
Returns a closed range that contains both of its bounds.
static func ..< (maximum: Self) -> PartialRangeUpTo<Self>
Returns a partial range up to, but not including, its upper bound.
static func ..< (minimum: Self, maximum: Self) -> Range<Self>
Returns a half-open range that contains its lower bound but not its upper bound.
static func <= (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether the value of the first argument is less than or equal to that of the second argument.
static func > (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether the value of the first argument is greater than that of the second argument.
static func >= (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether the value of the first argument is greater than or equal to that of the second argument.
class NSMutableString