# StringComparison

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/utilities/enum-stringcomparison/

**enum** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
enum StringComparison
```

Specifies the culture, case, and sort rules to be used by the comparisons
of strings.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/compare_info.rs#L45)

## Members

- [`CurrentCulture`](#variant-currentculture)
- [`CurrentCultureIgnoreCase`](#variant-currentcultureignorecase)
- [`InvariantCulture`](#variant-invariantculture)
- [`InvariantCultureIgnoreCase`](#variant-invariantcultureignorecase)
- [`Ordinal`](#variant-ordinal)
- [`OrdinalIgnoreCase`](#variant-ordinalignorecase)
- [`compare`](#function-compare)
- [`equals`](#function-equals)
- [`starts_with`](#function-starts_with)
- [`index_of`](#function-index_of)
- [`contains`](#function-contains)

<a id="variant-currentculture"></a>

### CurrentCulture

```rust
CurrentCulture = 0
```

Compare strings using culture-sensitive sort rules and the current
culture.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/compare_info.rs#L48)

<a id="variant-currentcultureignorecase"></a>

### CurrentCultureIgnoreCase

```rust
CurrentCultureIgnoreCase = 1
```

Compare strings using culture-sensitive sort rules, the current
culture, and ignoring the case of the strings being compared.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/compare_info.rs#L51)

<a id="variant-invariantculture"></a>

### InvariantCulture

```rust
InvariantCulture = 2
```

Compare strings using culture-sensitive sort rules and the invariant
culture.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/compare_info.rs#L54)

<a id="variant-invariantcultureignorecase"></a>

### InvariantCultureIgnoreCase

```rust
InvariantCultureIgnoreCase = 3
```

Compare strings using culture-sensitive sort rules, the invariant
culture, and ignoring the case of the strings being compared.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/compare_info.rs#L57)

<a id="variant-ordinal"></a>

### Ordinal

```rust
Ordinal = 4
```

Compare strings using ordinal (binary) sort rules.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/compare_info.rs#L59)

<a id="variant-ordinalignorecase"></a>

### OrdinalIgnoreCase

```rust
OrdinalIgnoreCase = 5
```

Compare strings using ordinal (binary) sort rules and ignoring the
case of the strings being compared.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/compare_info.rs#L62)

<a id="function-compare"></a>

### compare

```rust
fn compare(self: Self, a: &str, b: &str) -> Ordering
```

Compares two strings (`string.Compare(a, b, comparison)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/compare_info.rs#L81)

<a id="function-equals"></a>

### equals

```rust
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)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/compare_info.rs#L88)

<a id="function-starts_with"></a>

### starts_with

```rust
fn starts_with(self: Self, source: &str, prefix: &str) -> bool
```

Whether `source` starts with `prefix` (`source.StartsWith(prefix,
comparison)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/compare_info.rs#L98)

<a id="function-index_of"></a>

### index_of

```rust
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)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/compare_info.rs#L105)

<a id="function-contains"></a>

### contains

```rust
fn contains(self: Self, source: &str, value: &str) -> bool
```

Whether `value` occurs in `source` (`source.Contains(value,
comparison)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/compare_info.rs#L112)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ResourceKeyObject`](/docs/0.5.0/api/ferroui-base/controls/trait-resourcekeyobject/)
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Copy`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- `Eq`
- `Hash`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
