# `HL7v2.Type.ST`
[🔗](https://github.com/Balneario-de-Cofrentes/hl7v2/blob/v3.10.1/lib/hl7v2/type/st.ex#L1)

String Data (ST) -- HL7v2 primitive data type.

Lossless storage: the value is stored and returned as a plain binary string.
No delimiter rejection, length enforcement, or charset validation is performed.
The HL7 spec limits ST to 199 printable characters excluding delimiters, but
this implementation preserves all input bytes for round-trip fidelity.

# `encode`

```elixir
@spec encode(binary() | nil) :: binary()
```

Encodes a string value. Returns the string as-is, or empty string for nil.

## Examples

    iex> HL7v2.Type.ST.encode("Hello")
    "Hello"

    iex> HL7v2.Type.ST.encode(nil)
    ""

# `parse`

```elixir
@spec parse(binary() | nil) :: binary() | nil
```

Parses a string value. Returns the string as-is, or `nil` for empty/nil input.

## Examples

    iex> HL7v2.Type.ST.parse("Hello")
    "Hello"

    iex> HL7v2.Type.ST.parse("")
    nil

    iex> HL7v2.Type.ST.parse(nil)
    nil

---

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