# `Ash.CiString`
[🔗](https://github.com/ash-project/ash/blob/v3.17.0/lib/ash/ci_string.ex#L5)

Represents a case insensitive string

While some data layers are aware of case insensitive string types, in order for values
of this type to be used in other parts of Ash Framework, it has to be embedded in a module
this allows us to implement the `Comparable` protocol for it.

For the type implementation, see `Ash.Type.CiString`

# `casing`

```elixir
@type casing() :: nil | :lower | :upper
```

# `string_type`

```elixir
@type string_type() :: t() | String.t()
```

# `t`

```elixir
@type t() :: %Ash.CiString{case: casing(), casted?: boolean(), string: String.t()}
```

# `compare`

```elixir
@spec compare(string_type(), string_type()) :: :gt | :lt | :eq
```

Compares an Elixir String or Ash.CiString. It will return `:eq` if equal, `:lt`, if
the string is ordered alphabetically before the second string, and `:gt` if after.

# `new`

```elixir
@spec new(string_type() | nil, casing()) :: t() | nil
```

Returns a Ash.CiString from a String, or `nil` if the value is `nil`.

# `sigil_i`

```elixir
@spec sigil_i(
  string_type() | nil,
  charlist()
) :: t()
```

Creates a case insensitive string

# `to_comparable_string`

```elixir
@spec to_comparable_string(string_type() | nil) :: String.t() | nil
```

Returns the downcased value, only downcasing if it hasn't already been done

# `value`

```elixir
@spec value(t()) :: String.t()
```

Converts a `Ash.CiString` into a normal Elixir String.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
