<!--
{
  "documentType" : "article",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/strings-and-text",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Strings and Text"
}
-->

# Strings and Text

Create and process strings of Unicode characters, use regular expressions to find patterns, and perform natural language analysis of text.

## Topics

### Strings

  <doc://com.apple.documentation/documentation/Swift/String>

[String Encodings](/documentation/Foundation/1497293-string-encodings)

Constants for encoding standards used when converting raw data to and from string representations.

### Strings

[`NSString`](/documentation/Foundation/NSString)

A static, plain-text Unicode string object.

[`NSMutableString`](/documentation/Foundation/NSMutableString)

A dynamic plain-text Unicode string object.

  <doc:1497293-string_encodings>

### Strings with Metadata

[`AttributedString`](/documentation/Foundation/AttributedString)

A value type for a string with associated attributes for portions of its text.

[`AttributedSubstring`](/documentation/Foundation/AttributedSubstring)

A portion of an attributed string.

[Attributed String Supporting Types](/documentation/Foundation/attributed-string-supporting-types)

Types that the attributed string, attributed substring, and helper types extend or conform to, for sharing common functionality.

[`NSAttributedString`](/documentation/Foundation/NSAttributedString)

A string of text that manages data, layout, and stylistic information for ranges of characters to support rendering.

[`NSMutableAttributedString`](/documentation/Foundation/NSMutableAttributedString)

A mutable string with associated attributes (such as visual style, hyperlinks, or accessibility data) for portions of its text.

### Strings with Metadata

[`NSAttributedString`](/documentation/Foundation/NSAttributedString)

A string of text that manages data, layout, and stylistic information for ranges of characters to support rendering.

[`NSMutableAttributedString`](/documentation/Foundation/NSMutableAttributedString)

A mutable string with associated attributes (such as visual style, hyperlinks, or accessibility data) for portions of its text.

### Characters

[`CharacterSet`](/documentation/Foundation/CharacterSet)

A set of Unicode character values for use in search operations.

  <doc://com.apple.documentation/documentation/Swift/UnicodeScalar>

### Characters

[`NSCharacterSet`](/documentation/Foundation/NSCharacterSet)

An object representing a fixed set of Unicode character values for use in search operations.

[`NSMutableCharacterSet`](/documentation/Foundation/NSMutableCharacterSet)

An object representing a mutable set of Unicode character values for use in search operations.

[`unichar`](/documentation/Foundation/unichar)

Type for UTF-16 code units.

### Pattern Matching

[`Scanner`](/documentation/Foundation/Scanner)

A string parser that scans for substrings or characters in a character set, and for numeric values from decimal, hexadecimal, and floating-point representations.

[`NSRegularExpression`](/documentation/Foundation/NSRegularExpression)

An immutable representation of a compiled regular expression that you apply to Unicode strings.

[`NSDataDetector`](/documentation/Foundation/NSDataDetector)

A specialized regular expression object that matches natural language text for predefined data patterns.

[`NSTextCheckingResult`](/documentation/Foundation/NSTextCheckingResult)

An occurrence of textual content found during the analysis of a block of text, such as when matching a regular expression.

[`NSNotFound`](/documentation/Foundation/NSNotFound-4qp9h)

A value indicating that a requested item couldn’t be found or doesn’t exist.

### Spelling and Grammar

[`NSSpellServer`](/documentation/Foundation/NSSpellServer)

A server that your app uses to provide a spell checker service to other apps running in the system.

[`NSSpellServerDelegate`](/documentation/Foundation/NSSpellServerDelegate)

The optional methods implemented by the delegate of a spell server.

### Localization

[`Locale`](/documentation/Foundation/Locale)

Information about linguistic, cultural, and technological conventions for use in formatting data for presentation.

[`NSOrthography`](/documentation/Foundation/NSOrthography)

A description of the linguistic content of natural language text, typically used for spelling and grammar checking.

[`NSLocalizedString(_:tableName:bundle:value:comment:)`](/documentation/Foundation/NSLocalizedString(_:tableName:bundle:value:comment:))

Returns a localized string from a table that Xcode generates for you when exporting localizations.

[`LocalizedStringResource`](/documentation/Foundation/LocalizedStringResource)

A reference to a localizable string, accessible from another process.

[`CustomLocalizedStringResourceConvertible`](/documentation/Foundation/CustomLocalizedStringResourceConvertible)

A type that provides an out-of-process localizable description.

[`URLResource`](/documentation/Foundation/URLResource)

A resource located at a particular file URL within a bundle.

### Localization

[`NSLocale`](/documentation/Foundation/NSLocale)

Information about linguistic, cultural, and technological conventions for use in formatting data for presentation.

[`NSOrthography`](/documentation/Foundation/NSOrthography)

A description of the linguistic content of natural language text, typically used for spelling and grammar checking.

[`NSLocalizedString`](/documentation/Foundation/NSLocalizedString)

Returns a localized version of a string from the default table, which Xcode autogenerates when exporting localizations.

[`NSLocalizedStringFromTable`](/documentation/Foundation/NSLocalizedStringFromTable)

Returns a localized version of a string from the table that you specify, which Xcode autogenerates when exporting localizations.

[`NSLocalizedStringFromTableInBundle`](/documentation/Foundation/NSLocalizedStringFromTableInBundle)

Returns a localized version of a string from the table and bundle that you specify, which Xcode autogenerates when exporting localizations.

[`NSLocalizedStringWithDefaultValue`](/documentation/Foundation/NSLocalizedStringWithDefaultValue)

Returns a localized version of a string identified by a key in the table that you specify, which Xcode autogenerates when exporting localizations.

### Deprecated

[`NSLinguisticTagger`](/documentation/Foundation/NSLinguisticTagger)

Analyze natural language text to tag part of speech and lexical class, identify names, perform lemmatization, and determine the language and script.

[Deprecated String Encodings](/documentation/Foundation/1497268-deprecated-string-encodings)



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)