#[repr(i32)]pub enum StringComparison {
CurrentCulture = 0,
CurrentCultureIgnoreCase = 1,
InvariantCulture = 2,
InvariantCultureIgnoreCase = 3,
Ordinal = 4,
OrdinalIgnoreCase = 5,
}Expand description
Specifies the culture, case, and sort rules to be used by the comparisons of strings.
Variants§
CurrentCulture = 0
Compare strings using culture-sensitive sort rules and the current culture.
CurrentCultureIgnoreCase = 1
Compare strings using culture-sensitive sort rules, the current culture, and ignoring the case of the strings being compared.
InvariantCulture = 2
Compare strings using culture-sensitive sort rules and the invariant culture.
InvariantCultureIgnoreCase = 3
Compare strings using culture-sensitive sort rules, the invariant culture, and ignoring the case of the strings being compared.
Ordinal = 4
Compare strings using ordinal (binary) sort rules.
OrdinalIgnoreCase = 5
Compare strings using ordinal (binary) sort rules and ignoring the case of the strings being compared.
Implementations§
Source§impl StringComparison
impl StringComparison
Sourcepub fn compare(self, a: &str, b: &str) -> Ordering
pub fn compare(self, a: &str, b: &str) -> Ordering
Compares two strings (string.Compare(a, b, comparison)).
Sourcepub fn equals(self, a: Option<&str>, b: Option<&str>) -> bool
pub fn equals(self, a: Option<&str>, b: Option<&str>) -> bool
Whether two strings, either of which may be null, are equal
(string.Equals(a, b, comparison)).
Sourcepub fn starts_with(self, source: &str, prefix: &str) -> bool
pub fn starts_with(self, source: &str, prefix: &str) -> bool
Whether source starts with prefix (source.StartsWith(prefix, comparison)).
Trait Implementations§
Source§impl Clone for StringComparison
impl Clone for StringComparison
impl Copy for StringComparison
Source§impl Debug for StringComparison
impl Debug for StringComparison
impl Eq for StringComparison
Source§impl Hash for StringComparison
impl Hash for StringComparison
Source§impl PartialEq for StringComparison
impl PartialEq for StringComparison
impl StructuralPartialEq for StringComparison
Auto Trait Implementations§
impl Freeze for StringComparison
impl RefUnwindSafe for StringComparison
impl Send for StringComparison
impl Sync for StringComparison
impl Unpin for StringComparison
impl UnsafeUnpin for StringComparison
impl UnwindSafe for StringComparison
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more