# StringValidation module
{: .no_toc }

Holds the small string tests and the case helper that the package's formatter is built on.

**StringValidation** is a standard module of five public functions. [**StringContains**](/tB/Packages/Contributed/Fmt/StringValidation/StringContains.md), [**StringContainsAny**](/tB/Packages/Contributed/Fmt/StringValidation/StringContainsAny.md), [**StringMatchesAny**](/tB/Packages/Contributed/Fmt/StringValidation/StringMatchesAny.md) and [**StringStartsWith**](/tB/Packages/Contributed/Fmt/StringValidation/StringStartsWith.md) return a **Boolean** about the text of a string, and [**CopyCapitalisation**](/tB/Packages/Contributed/Fmt/StringValidation/CopyCapitalisation.md) returns a string in the letter case of another. The formatter calls them to look for backslashes and escape sequences, to test whether a format string begins with `@` and to follow the case of an identifier. A project that references the package can call them too, by name or as `StringValidation.StringContains`.

> [!NOTE] BETA 1042
> The package declares the module with `Option Private Module`, which marks it as internal to the package. A project that references the package can still call its functions.

```tb check_build check_run
Debug.Print StringContains("Hello", "ELL")               ' True
Debug.Print StringContainsAny("Hello", False, "x", "L")  ' True
Debug.Print StringMatchesAny("b", "a", "b", "c")         ' True
Debug.Print StringStartsWith("He", "Hello")              ' True
Debug.Print CopyCapitalisation("HELLO", "world")         ' WORLD
```

## Functions

- [CopyCapitalisation](/tB/Packages/Contributed/Fmt/StringValidation/CopyCapitalisation.md) -- returns a string in upper case or lower case, following another string
- [StringContains](/tB/Packages/Contributed/Fmt/StringValidation/StringContains.md) -- returns whether a string contains another, ignoring case unless asked not to
- [StringContainsAny](/tB/Packages/Contributed/Fmt/StringValidation/StringContainsAny.md) -- returns whether a string contains any one of several strings
- [StringMatchesAny](/tB/Packages/Contributed/Fmt/StringValidation/StringMatchesAny.md) -- returns whether a string is equal to any one of several values
- [StringStartsWith](/tB/Packages/Contributed/Fmt/StringValidation/StringStartsWith.md) -- returns whether a string begins with another, taking case into account

## See Also

- [StringFormat](/tB/Packages/Contributed/Fmt/PublicEntryPoints/StringFormat.md) function -- the formatter that uses these functions
- [Fmt package](/tB/Packages/Contributed/Fmt/index.md) -- overview
