effect-io-ai

Package: effect
Module: Order

Order.String

Order instance for strings that compares them lexicographically using JavaScript’s < operator.

When to use

Use when you need lexicographic string ordering.

Details

Uses lexicographic dictionary ordering. The empty string is less than any non-empty string, and comparisons are case-sensitive.

Example (Ordering strings)

import { Order } from "effect"

console.log(Order.String("apple", "banana")) // -1
console.log(Order.String("banana", "apple")) // 1
console.log(Order.String("apple", "apple")) // 0

See

Signature

declare const String: Order<string>

Source

Since v4.0.0