Trait INSString

Source
pub trait INSString: PNSObject {
Show 71 methods // Provided methods fn m_string() -> Self where Self: Sized + FromId { ... } fn m_init(&mut self) -> Self where Self: Sized + FromId { ... } fn m_init_with_bytes_length_encoding( &mut self, bytes: *const c_void, len: UInt, encoding: Encoding, ) -> Self where Self: Sized + FromId { ... } fn m_init_with_bytes_no_copy_length_encoding_free_when_done( &mut self, bytes: *mut c_void, len: UInt, encoding: Encoding, free_buffer: bool, ) -> Self where Self: Sized + FromId { ... } fn m_init_with_characters_length( &mut self, characters: *const unichar, len: UInt, ) -> Self where Self: Sized + FromId { ... } fn m_init_with_characters_no_copy_length_free_when_done( &mut self, characters: unichar, length: UInt, free_buffer: bool, ) -> Self where Self: Sized + FromId { ... } fn m_init_with_string<S>(&mut self, s: S) -> Self where Self: Sized + FromId, S: INSString { ... } fn m_init_with_cstring_encoding( &mut self, c_str: *const c_char, encoding: Encoding, ) -> Self where Self: Sized + FromId { ... } fn m_init_with_utf8_string(&mut self, c_str: *const c_char) -> Self where Self: Sized + FromId { ... } fn m_init_with_data_encoding( &mut self, data: NSData, encoding: Encoding, ) -> Self where Self: Sized + FromId { ... } fn m_localized_user_notification_string_for_key_arguments<T>( key: NSString, arguments: NSArray<T>, ) -> NSString where T: PNSObject { ... } fn m_string_with_characters_length( characters: *const unichar, length: UInt, ) -> Self where Self: Sized + FromId { ... } fn m_string_with_string(s: NSString) -> Self where Self: Sized + 'static + FromId { ... } fn m_string_with_cstring_encoding( c_str: *const c_char, encoding: Encoding, ) -> Self where Self: Sized + FromId { ... } fn m_string_with_utf8_string(c_str: *const c_char) -> Self where Self: Sized + FromId { ... } fn m_string_with_contents_of_file_encoding( path: &NSString, enc: Encoding, ) -> Result<Self, NSError> where Self: Sized + FromId { ... } fn m_init_with_contents_of_file_encoding( &mut self, path: &NSString, enc: Encoding, ) -> Result<Self, NSError> where Self: Sized + FromId { ... } fn m_string_with_contents_of_file_used_encoding( path: &NSString, enc: Encoding, ) -> Result<Self, NSError> where Self: Sized + FromId { ... } fn m_init_with_contents_of_file_used_encoding( &mut self, path: &NSString, enc: Encoding, ) -> Result<Self, NSError> where Self: Sized + FromId { ... } fn m_string_with_contents_of_url_encoding( path: &NSURL, enc: Encoding, ) -> Result<Self, NSError> where Self: Sized + FromId { ... } fn m_init_with_contents_of_url_encoding( &mut self, path: &NSURL, enc: Encoding, ) -> Result<Self, NSError> where Self: Sized + FromId { ... } fn m_string_with_contents_of_url_used_encoding( path: &NSURL, enc: Encoding, ) -> Result<Self, NSError> where Self: Sized + FromId { ... } fn m_init_with_contents_of_url_used_encoding( &mut self, path: &NSURL, enc: Encoding, ) -> Result<Self, NSError> where Self: Sized + FromId { ... } fn p_length(&self) -> UInt { ... } fn m_length_of_bytes_using_encoding(&self, enc: Encoding) -> UInt { ... } fn m_maximum_length_of_bytes_using_encoding(&self, enc: Encoding) -> Int { ... } fn m_character_at_index(&self, index: UInt) -> char { ... } fn m_get_characters_range(&self, buffer: *mut unichar, range: NSRange) { ... } fn m_get_bytes_max_length_used_length_encoding_options_range_remaining_range( &self, buffer: *mut c_void, max_length: Int, used_length: *mut Int, encoding: Encoding, options: NSStringEncodingConversionOptions, range: NSRange, remaining_range: NSRange, ) -> bool { ... } fn m_c_string_using_encoding(&self, encoding: Encoding) -> *const c_char { ... } fn m_get_cstring_max_length_encoding( &self, buffer: *mut c_char, max_length: UInt, encoding: Encoding, ) -> bool { ... } fn p_utf8_string(&self) -> *const c_char { ... } fn m_case_insensitive_compare<S>(&self, string: S) -> NSComparisonResult where S: INSString { ... } fn m_localized_case_insensitive_compare<S>( &self, string: S, ) -> NSComparisonResult where S: INSString { ... } fn m_compare<S>(&self, string: S) -> NSComparisonResult where S: INSString { ... } fn m_localized_compare<S>(&self, string: S) -> NSComparisonResult where S: INSString { ... } fn m_compare_options<S>( &self, string: S, mask: NSStringCompareOptions, ) -> NSComparisonResult where S: INSString { ... } fn m_compare_options_range<S>( &self, string: S, mask: NSStringCompareOptions, range: NSRange, ) -> NSComparisonResult where S: INSString { ... } fn m_compare_options_range_locale<S>( &self, string: S, mask: NSStringCompareOptions, range: NSRange, locale: NSLocale, ) -> NSComparisonResult where S: INSString { ... } fn m_localized_standard_compare<S>(&self, string: S) -> NSComparisonResult where S: INSString { ... } fn m_has_prefix<S>(&self, prefix: S) -> bool where S: INSString { ... } fn m_has_suffix<S>(&self, suffix: S) -> bool where S: INSString { ... } fn m_is_equal_to_string<S>(&self, string: S) -> bool where S: INSString { ... } fn m_string_by_appending_string<S>(&self, string: S) -> NSString where S: INSString { ... } fn m_string_by_padding_to_length_with_string_starting_at_index<S>( &self, new_length: UInt, pad_string: S, starting_at: UInt, ) -> NSString where S: INSString { ... } fn p_lowercase_string(&self) -> NSString { ... } fn p_localized_lowercase_string(&self) -> NSString { ... } fn m_lowercase_string_with_locale(&self, locale: NSLocale) -> NSString { ... } fn p_uppercase_string(&self) -> NSString { ... } fn p_localized_uppercase_string(&self) -> NSString { ... } fn m_uppercase_string_with_locale(&self, locale: NSLocale) -> NSString { ... } fn p_capitalized_string(&self) -> NSString { ... } fn p_localized_capitalized_string(&self) -> NSString { ... } fn m_capitalized_string_with_locale(&self, locale: NSLocale) -> NSString { ... } fn m_components_separated_by_string<S>( &self, separator: S, ) -> NSArray<NSString> where S: INSString { ... } fn m_components_separated_by_characters_in_set( &self, separator: &NSCharacterSet, ) -> NSArray<NSString> { ... } fn m_string_by_trimming_characters_in_set( &self, set: &NSCharacterSet, ) -> NSString { ... } fn m_substring_from_index(&self, from: UInt) -> NSString { ... } fn m_substring_with_range(&self, range: NSRange) -> NSString { ... } fn m_substring_to_index(&self, to: UInt) -> NSString { ... } fn p_decomposed_string_with_canonical_mapping(&self) -> NSString { ... } fn p_decomposed_string_with_compatibility_mapping(&self) -> NSString { ... } fn p_precomposed_string_with_canonical_mapping(&self) -> NSString { ... } fn p_precomposed_string_with_compatibility_mapping(&self) -> NSString { ... } fn m_string_by_folding_with_options_locale( &mut self, options: NSStringCompareOptions, locale: &NSLocale, ) -> NSString { ... } fn m_string_by_applying_transform_reverse( &mut self, transform: NSStringTransform, reverse: bool, ) -> Option<NSString> { ... } fn m_contains_string<S>(&self, other: S) -> bool where S: INSString { ... } fn p_available_string_encodings() -> *const Encoding { ... } fn p_default_cstring_encoding() -> Encoding { ... } fn m_can_be_converted_to_encoding(&self, encoding: Encoding) -> bool { ... } fn m_data_using_encoding(&self, encoding: Encoding) -> NSData { ... }
}
Expand description

A trait containing all the methods for NSString

Provided Methods§

Source

fn m_string() -> Self
where Self: Sized + FromId,

Returns an empty string.

Source

fn m_init(&mut self) -> Self
where Self: Sized + FromId,

Returns an initialized NSString object that contains no characters.

Source

fn m_init_with_bytes_length_encoding( &mut self, bytes: *const c_void, len: UInt, encoding: Encoding, ) -> Self
where Self: Sized + FromId,

Returns an initialized NSString object containing a given number of bytes from a given buffer of bytes interpreted in a given encoding.

§Arguments
  • bytes - A buffer of bytes interpreted in the encoding specified by encoding.

  • len - The number of bytes to use from bytes.

  • encoding - The character encoding applied to bytes. For possible values, see NSStringEncoding.

§Returns

An initialized NSString object containing length bytes from bytes interpreted using the encoding encoding. The returned object may be different from the original receiver.

Source

fn m_init_with_bytes_no_copy_length_encoding_free_when_done( &mut self, bytes: *mut c_void, len: UInt, encoding: Encoding, free_buffer: bool, ) -> Self
where Self: Sized + FromId,

Returns an initialized NSString object that contains a given number of bytes from a given buffer of bytes interpreted in a given encoding, and optionally frees the buffer.

§Arguments
  • bytes - A buffer of bytes interpreted in the encoding specified by encoding.
  • len - The number of bytes to use from bytes.
  • encoding - The character encoding applied to bytes. For possible values, see NSStringEncoding.
  • free_buffer - If YES, bytes is freed after use.
§Returns

An initialized NSString object containing length bytes from bytes interpreted using the encoding encoding. The returned object may be different from the original receiver.

Source

fn m_init_with_characters_length( &mut self, characters: *const unichar, len: UInt, ) -> Self
where Self: Sized + FromId,

Returns an initialized NSString object that contains a given number of characters from a given C array of UTF-16 code units.

§Arguments
  • characters - A C array of UTF-16 code units; the value must not be NULL.
  • length - A C array of UTF-16 code units; the value must not be NULL.
§Returns

An initialized NSString object containing length characters from characters.

Source

fn m_init_with_characters_no_copy_length_free_when_done( &mut self, characters: unichar, length: UInt, free_buffer: bool, ) -> Self
where Self: Sized + FromId,

Returns an initialized NSString object that contains a given number of characters from a given C array of UTF-16 code units.

§Arguments
  • characters - A C array of UTF-16 code units; the value must not be NULL.
  • length - A C array of UTF-16 code units; the value must not be NULL.
  • free_buffer - If YES, characters is freed after use.
§Returns

An initialized NSString object containing length characters from characters.

Source

fn m_init_with_string<S>(&mut self, s: S) -> Self
where Self: Sized + FromId, S: INSString,

Returns an NSString object initialized by copying the characters from another given string.

§Arguments
  • s - The string from which to copy characters. This value must not be nil.
§Returns

An NSString object initialized by copying the characters from s.

Source

fn m_init_with_cstring_encoding( &mut self, c_str: *const c_char, encoding: Encoding, ) -> Self
where Self: Sized + FromId,

Returns an NSString object initialized using the characters in a given C array, interpreted according to a given encoding.

§Arguments
  • c_str - A C array of bytes.
  • encoding - The encoding to use to interpret c_str. For possible values, see NSStringEncoding.
§Returns

An NSString object initialized using the characters in c_str, interpreted according to encoding.

Source

fn m_init_with_utf8_string(&mut self, c_str: *const c_char) -> Self
where Self: Sized + FromId,

Returns an NSString object initialized using the characters in a given C array, interpreted according to a UTF8 string.

§Arguments
  • c_str - A C array of bytes.
§Returns

An NSString object initialized using the characters in c_str, interpreted as a UTF8 string.

Source

fn m_init_with_data_encoding( &mut self, data: NSData, encoding: Encoding, ) -> Self
where Self: Sized + FromId,

Returns an NSString object initialized by converting given data into UTF-16 code units using a given encoding.

§Arguments
  • data - The data to convert into UTF-16 code units.
  • encoding - The encoding to use to interpret data. For possible values, see NSStringEncoding.
§Returns

An NSString object initialized by converting data into UTF-16 code units using encoding.

Source

fn m_localized_user_notification_string_for_key_arguments<T>( key: NSString, arguments: NSArray<T>, ) -> NSString
where T: PNSObject,

Returns a localized string intended for display in a notification alert.

§Arguments
  • key - The key to use when looking up the string in the app’s Localizable.strings file.
  • arguments - An array of values to substitute for escaped characters in the string.
Source

fn m_string_with_characters_length( characters: *const unichar, length: UInt, ) -> Self
where Self: Sized + FromId,

Returns a string containing a given number of characters taken from a given C array of UTF-16 code units.

§Arguments
  • characters - A C array of UTF-16 code units; the value must not be NULL.
  • length - A C array of UTF-16 code units; the value must not be NULL.
§Returns

An NSString object containing length characters from characters.

Source

fn m_string_with_string(s: NSString) -> Self
where Self: Sized + 'static + FromId,

Returns a string created by copying the characters from another given string.

§Arguments
  • s - The string from which to copy characters. This value must not be nil.
§Returns

An NSString object initialized by copying the characters from s.

Source

fn m_string_with_cstring_encoding( c_str: *const c_char, encoding: Encoding, ) -> Self
where Self: Sized + FromId,

Returns a string containing the bytes in a given C array, interpreted according to a given encoding.

§Arguments
  • c_str - A C array of bytes.
  • encoding - The encoding to use to interpret c_str. For possible values, see NSStringEncoding.
§Returns

An NSString object containing the bytes in c_str, interpreted according to encoding.

Source

fn m_string_with_utf8_string(c_str: *const c_char) -> Self
where Self: Sized + FromId,

Returns a string created by copying the data from a given C array of UTF8-encoded bytes.

§Arguments
  • c_str - A C array of bytes.
§Returns

An NSString object containing the bytes in c_str, interpreted as a UTF8 string.

Source

fn m_string_with_contents_of_file_encoding( path: &NSString, enc: Encoding, ) -> Result<Self, NSError>
where Self: Sized + FromId,

Returns a string created by reading data from the file at a given path interpreted using a given encoding.

Source

fn m_init_with_contents_of_file_encoding( &mut self, path: &NSString, enc: Encoding, ) -> Result<Self, NSError>
where Self: Sized + FromId,

Returns an NSString object initialized by reading data from the file at a given path using a given encoding.

Source

fn m_string_with_contents_of_file_used_encoding( path: &NSString, enc: Encoding, ) -> Result<Self, NSError>
where Self: Sized + FromId,

Returns an NSString object initialized by reading data from the file at a given path using a given encoding.

Source

fn m_init_with_contents_of_file_used_encoding( &mut self, path: &NSString, enc: Encoding, ) -> Result<Self, NSError>
where Self: Sized + FromId,

Returns a string created by reading data from the file at a given path and returns by reference the encoding used to interpret the file.

Source

fn m_string_with_contents_of_url_encoding( path: &NSURL, enc: Encoding, ) -> Result<Self, NSError>
where Self: Sized + FromId,

Returns a string created by reading data from a given URL interpreted using a given encoding.

Source

fn m_init_with_contents_of_url_encoding( &mut self, path: &NSURL, enc: Encoding, ) -> Result<Self, NSError>
where Self: Sized + FromId,

Returns an NSString object initialized by reading data from a given URL interpreted using a given encoding.

Source

fn m_string_with_contents_of_url_used_encoding( path: &NSURL, enc: Encoding, ) -> Result<Self, NSError>
where Self: Sized + FromId,

Returns a string created by reading data from a given URL and returns by reference the encoding used to interpret the data.

Source

fn m_init_with_contents_of_url_used_encoding( &mut self, path: &NSURL, enc: Encoding, ) -> Result<Self, NSError>
where Self: Sized + FromId,

Returns an NSString object initialized by reading data from a given URL and returns by reference the encoding used to interpret the data.

Source

fn p_length(&self) -> UInt

The number of Unicode characters in this string.

Source

fn m_length_of_bytes_using_encoding(&self, enc: Encoding) -> UInt

Returns the number of bytes required to store the receiver in a given encoding.

§Arguments
  • enc - The encoding for which to determine the receiver’s length.
§Returns

The number of bytes required to store the receiver in the encoding enc in a non-external representation. The length does not include space for a terminating NULL character. Returns 0 if the specified encoding cannot be used to convert the receiver or if the amount of memory required for storing the results of the encoding conversion would exceed NSIntegerMax.

Source

fn m_maximum_length_of_bytes_using_encoding(&self, enc: Encoding) -> Int

Returns the maximum number of bytes needed to store the receiver in a given encoding.

§Arguments
  • enc - The encoding for which to determine the receiver’s length.
§Returns

The maximum number of bytes needed to store the receiver in encoding in a non-external representation. The length does not include space for a terminating NULL character. Returns 0 if the amount of memory required for storing the results of the encoding conversion would exceed NSIntegerMax.

Source

fn m_character_at_index(&self, index: UInt) -> char

Returns the character at a given UTF-16 code unit index.

§Arguments
  • index - The character at the array position given by index.
§Returns

The character at the array position given by index.

Source

fn m_get_characters_range(&self, buffer: *mut unichar, range: NSRange)

Copies characters from a given range in the receiver into a given buffer.

§Arguments
  • buffer - Upon return, contains the characters from the receiver. buffer must be large enough to contain the characters in the range aRange (aRange.length*sizeof(unichar)).
  • range - The range of characters to copy.
Source

fn m_get_bytes_max_length_used_length_encoding_options_range_remaining_range( &self, buffer: *mut c_void, max_length: Int, used_length: *mut Int, encoding: Encoding, options: NSStringEncodingConversionOptions, range: NSRange, remaining_range: NSRange, ) -> bool

Gets a given range of characters as bytes in a specified encoding.

§Arguments
  • buffer - Upon return, contains the bytes from the receiver. buffer must be large enough to contain the bytes in the range aRange (aRange.length*sizeof(char)).
  • `maxLength - The maximum number of bytes to get.
  • usedLength - Upon return, contains the actual number of bytes retrieved.
  • encoding - The encoding to use to interpret the bytes. For possible values, see NSStringEncoding.
  • options - The options to use for converting the receiver into the specified encoding. For possible values, see NSStringEncodingConversionOptions.
  • range - The range of characters to get.
  • remainingRange - Upon return, contains a range containing the remaining characters.
Source

fn m_c_string_using_encoding(&self, encoding: Encoding) -> *const c_char

Returns a representation of the string as a C string using a given encoding.

§Arguments
  • encoding - The encoding to use to interpret the receiver. For possible values, see NSStringEncoding.
§Returns

A pointer to a C string containing the receiver. The pointer is owned by the string, and must not be freed by the caller.

Source

fn m_get_cstring_max_length_encoding( &self, buffer: *mut c_char, max_length: UInt, encoding: Encoding, ) -> bool

Returns a representation of the string as a C string.

§Arguments
  • buffer - Upon return, contains the characters from the receiver. buffer must be large enough to contain the characters in the receiver.
  • maxLength - The maximum number of bytes to write into buffer.
  • encoding - The encoding to use to interpret the receiver. For possible values, see NSStringEncoding.
§Returns

true if the operation was successful, otherwise false. Returns false if conversion is not possible due to encoding errors or if buffer is too small.

Source

fn p_utf8_string(&self) -> *const c_char

A null-terminated UTF8 representation of the string.

Source

fn m_case_insensitive_compare<S>(&self, string: S) -> NSComparisonResult
where S: INSString,

Returns the result of invoking compare:options: with NSCaseInsensitiveSearch as the only option.

§Arguments
  • string - The string to compare.
§Returns

Returns an ComparisonResult value that indicates the lexical ordering. OrderedAscending the receiver precedes string in lexical ordering, OrderedSame the receiver and string are equivalent in lexical value, and OrderedDescending if the receiver follows string.

Source

fn m_localized_case_insensitive_compare<S>( &self, string: S, ) -> NSComparisonResult
where S: INSString,

Compares the string with a given string using a case-insensitive, localized, comparison.

§Arguments
  • string - The string to compare.
§Returns

Returns an ComparisonResult value that indicates the lexical ordering. OrderedAscending the receiver precedes string in lexical ordering, OrderedSame the receiver and string are equivalent in lexical value, and OrderedDescending if the receiver follows string

Source

fn m_compare<S>(&self, string: S) -> NSComparisonResult
where S: INSString,

Returns the result of invoking compare:options:range: with no options and the receiver’s full extent as the range.

§Arguments
  • string - The string with which to compare the receiver.
§Safety

This value must not be nil. If this value is nil, the behavior is undefined and may change in future versions of macOS.

§Returns

Returns an ComparisonResult value that indicates the lexical ordering. OrderedAscending the receiver precedes string in lexical ordering, OrderedSame the receiver and string are equivalent in lexical value, and OrderedDescending if the receiver follows string

Source

fn m_localized_compare<S>(&self, string: S) -> NSComparisonResult
where S: INSString,

Returns the result of invoking compare:options:range: with no options and the receiver’s full extent as the range.

§Arguments
  • string - The string with which to compare the receiver.

Returns an ComparisonResult value that indicates the lexical ordering. OrderedAscending the receiver precedes string in lexical ordering, OrderedSame the receiver and string are equivalent in lexical value, and OrderedDescending if the receiver follows string

Source

fn m_compare_options<S>( &self, string: S, mask: NSStringCompareOptions, ) -> NSComparisonResult
where S: INSString,

Compares the string with the specified string using the given options.

§Arguments
  • string - The string to compare.
  • mask - The mask to use when comparing the receiver and string.
§Returns

Returns an ComparisonResult value that indicates the lexical ordering.

Source

fn m_compare_options_range<S>( &self, string: S, mask: NSStringCompareOptions, range: NSRange, ) -> NSComparisonResult
where S: INSString,

Compares the string with the specified string using the given options.

§Arguments
  • string - The string to compare.
  • mask - The mask to use when comparing the receiver and string.
  • range - The range of the receiver to compare.
Source

fn m_compare_options_range_locale<S>( &self, string: S, mask: NSStringCompareOptions, range: NSRange, locale: NSLocale, ) -> NSComparisonResult
where S: INSString,

Compares the string using the specified options and returns the lexical ordering for the range.

§Arguments
  • string - The string to compare.
  • mask - The mask to use when comparing the receiver and string.
  • range - The range to compare.
  • locale - The locale to use when comparing the receiver and string.
§Returns

Returns an ComparisonResult value that indicates the lexical ordering.

Source

fn m_localized_standard_compare<S>(&self, string: S) -> NSComparisonResult
where S: INSString,

Compares strings as sorted by the Finder.

§Arguments
  • string - The string to compare with the receiver.
§Returns

The result of the comparison.

Source

fn m_has_prefix<S>(&self, prefix: S) -> bool
where S: INSString,

Returns a Boolean value that indicates whether a given string matches the beginning characters of the receiver.

§Arguments
  • prefix - The prefix to search for.
§Returns

Returns true if the string begins with the prefix, otherwise false.

Source

fn m_has_suffix<S>(&self, suffix: S) -> bool
where S: INSString,

Returns a Boolean value that indicates whether a given string matches the ending characters of the receiver.

§Arguments
  • suffix - The suffix to search for.
§Returns

Returns true if the string ends with the suffix, otherwise false.

Source

fn m_is_equal_to_string<S>(&self, string: S) -> bool
where S: INSString,

Returns a Boolean value that indicates whether a given string is equal to the receiver using a literal Unicode-based comparison.

§Arguments
  • string - The string to compare with the receiver.
§Returns

Returns true if the string is equal to the receiver, otherwise false.

Source

fn m_string_by_appending_string<S>(&self, string: S) -> NSString
where S: INSString,

Returns a new string made by appending a given string to the receiver.

§Arguments
  • string - The string to append to the receiver. This value must not be nil.
Source

fn m_string_by_padding_to_length_with_string_starting_at_index<S>( &self, new_length: UInt, pad_string: S, starting_at: UInt, ) -> NSString
where S: INSString,

Returns a new string formed from the receiver by either removing characters from the end, or by appending as many occurrences as necessary of a given pad string.

§Arguments
  • new_length - The number of characters to be contained in the new string.
  • pad - The string to use for padding.
  • starting_at - The index in pad_string from which to start padding.
§Returns

A new string formed from the receiver by either removing characters from the end, or by appending as many occurrences of pad_string as necessary.

Source

fn p_lowercase_string(&self) -> NSString

A lowercase representation of the string.

Source

fn p_localized_lowercase_string(&self) -> NSString

Returns a version of the string with all letters converted to lowercase, taking into account the current locale.

Source

fn m_lowercase_string_with_locale(&self, locale: NSLocale) -> NSString

Returns a version of the string with all letters converted to lowercase, taking into account the specified locale.

§Arguments
  • locale - The locale to use when converting the letters to lowercase.
§Returns

A new string with all letters converted to lowercase.

Source

fn p_uppercase_string(&self) -> NSString

An uppercase representation of the string.

Source

fn p_localized_uppercase_string(&self) -> NSString

Returns a version of the string with all letters converted to uppercase, taking into account the current locale.

Source

fn m_uppercase_string_with_locale(&self, locale: NSLocale) -> NSString

Returns a version of the string with all letters converted to uppercase, taking into account the specified locale.

§Arguments
  • locale - The locale to use when converting the letters to uppercase.
§Returns

A new string with all letters converted to uppercase.

Source

fn p_capitalized_string(&self) -> NSString

A capitalized representation of the string.

Source

fn p_localized_capitalized_string(&self) -> NSString

Returns a capitalized representation of the receiver using the current locale.

Source

fn m_capitalized_string_with_locale(&self, locale: NSLocale) -> NSString

Returns a capitalized representation of the receiver using the specified locale.

Source

fn m_components_separated_by_string<S>(&self, separator: S) -> NSArray<NSString>
where S: INSString,

Returns an array containing substrings from the receiver that have been divided by a given separator.

Source

fn m_components_separated_by_characters_in_set( &self, separator: &NSCharacterSet, ) -> NSArray<NSString>

Returns an array containing substrings from the receiver that have been divided by characters in a given set.

Source

fn m_string_by_trimming_characters_in_set( &self, set: &NSCharacterSet, ) -> NSString

Returns a new string made by removing from both ends of the receiver characters contained in a given character set.

Source

fn m_substring_from_index(&self, from: UInt) -> NSString

Returns a new string containing the characters of the receiver from the one at a given index to the end.

Source

fn m_substring_with_range(&self, range: NSRange) -> NSString

Returns a string object containing the characters of the receiver that lie within a given range.

Source

fn m_substring_to_index(&self, to: UInt) -> NSString

Returns a new string containing the characters of the receiver up to, but not including, the one at a given index.

Source

fn p_decomposed_string_with_canonical_mapping(&self) -> NSString

A string made by normalizing the string’s contents using the Unicode Normalization Form D.

Source

fn p_decomposed_string_with_compatibility_mapping(&self) -> NSString

A string made by normalizing the receiver’s contents using the Unicode Normalization Form KD.

Source

fn p_precomposed_string_with_canonical_mapping(&self) -> NSString

A string made by normalizing the string’s contents using the Unicode Normalization Form C.

Source

fn p_precomposed_string_with_compatibility_mapping(&self) -> NSString

A string made by normalizing the receiver’s contents using the Unicode Normalization Form KC.

Source

fn m_string_by_folding_with_options_locale( &mut self, options: NSStringCompareOptions, locale: &NSLocale, ) -> NSString

Creates a string suitable for comparison by removing the specified character distinctions from a string.

Source

fn m_string_by_applying_transform_reverse( &mut self, transform: NSStringTransform, reverse: bool, ) -> Option<NSString>

Returns a new string made by appending to the receiver a given string.

§Arguments
  • transform - The StringTransform to apply.
  • reverse - If true, the transformation is applied in reverse.
Source

fn m_contains_string<S>(&self, other: S) -> bool
where S: INSString,

Returns a boolean value indicating whether the string contains a given string by performing a case-sensitive, locale-unaware search.

§Arguments
  • string - The string to search for.
§Returns

Returns true if string is contained in the receiver, otherwise false.

Source

fn p_available_string_encodings() -> *const Encoding

Returns a zero-terminated list of the encodings string objects support in the application’s environment.

Source

fn p_default_cstring_encoding() -> Encoding

Returns the C-string encoding assumed for any method accepting a C string as an argument.

Source

fn m_can_be_converted_to_encoding(&self, encoding: Encoding) -> bool

Returns a Boolean value that indicates whether the receiver can be converted to a given encoding without loss of information.

Source

fn m_data_using_encoding(&self, encoding: Encoding) -> NSData

Returns an NSData object containing a representation of the receiver encoded using a given encoding.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§