StringComparison
enum · ferroui-base · v0.5.0
enum StringComparison
Specifies the culture, case, and sort rules to be used by the comparisons of strings.
Members
CurrentCultureCurrentCultureIgnoreCaseInvariantCultureInvariantCultureIgnoreCaseOrdinalOrdinalIgnoreCasecompareequalsstarts_withindex_ofcontains
CurrentCulture
CurrentCulture = 0
Compare strings using culture-sensitive sort rules and the current culture.
CurrentCultureIgnoreCase
CurrentCultureIgnoreCase = 1
Compare strings using culture-sensitive sort rules, the current culture, and ignoring the case of the strings being compared.
InvariantCulture
InvariantCulture = 2
Compare strings using culture-sensitive sort rules and the invariant culture.
InvariantCultureIgnoreCase
InvariantCultureIgnoreCase = 3
Compare strings using culture-sensitive sort rules, the invariant culture, and ignoring the case of the strings being compared.
Ordinal
Ordinal = 4
Compare strings using ordinal (binary) sort rules.
OrdinalIgnoreCase
OrdinalIgnoreCase = 5
Compare strings using ordinal (binary) sort rules and ignoring the case of the strings being compared.
compare
fn compare(self: Self, a: &str, b: &str) -> Ordering
Compares two strings (string.Compare(a, b, comparison)).
equals
fn equals(self: Self, a: Option<&str>, b: Option<&str>) -> bool
Whether two strings, either of which may be null, are equal
(string.Equals(a, b, comparison)).
starts_with
fn starts_with(self: Self, source: &str, prefix: &str) -> bool
Whether source starts with prefix (source.StartsWith(prefix, comparison)).
index_of
fn index_of(self: Self, source: &str, value: &str) -> i32
The position of the first occurrence of value in source in
UTF-16 code units, or -1 (source.IndexOf(value, comparison)).
contains
fn contains(self: Self, source: &str, value: &str) -> bool
Whether value occurs in source (source.Contains(value, comparison)).
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeResourceKeyObjectPropertyValueAnyValueClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedErasedDestructorIntoEitherCloneCopyDebugStructuralPartialEqPartialEqEqHash
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.