---
title: Text and array case-conversion utilities
summary: Proper-casing, capital-letter padding, array-level case conversion, numeric-only checks, and sentence-casing helper functions.
status: draft
owner: <owner>
last_reviewed: 2026-07-30
library: SAIF.Business.Utilities
reference_type: package
operation_id: OP-BU-03
trigger: Caller calls ToProperCase, ToPadCapitalLetters, ToLower/ToUpper (array), ContainsOnlyNumericCharacters, or ToSentenceCase
---

# Text and array case-conversion utilities

This operation groups five small, single-purpose string and array helper functions that supplement [Title-case a string](title-case-a-string.md): proper-casing via the .NET built-in converter, capital-letter padding, array-level upper/lower casing, a numeric-only character check, and sentence-casing. Each is a thin, largely unconditional transformation with at most one branch, so they are documented together rather than as five separate operation pages.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-BU-03 |
| **Trigger** | Caller calls any of `Target.ToProperCase()`, `Target.ToPadCapitalLetters()`, `Target().ToLower()`, `Target().ToUpper()`, `Target.ContainsOnlyNumericCharacters()`, or `Target.ToSentenceCase()` |
| **Inputs** | `Target As String` (most functions) or `Target() As String` (array case-conversion) |
| **Outputs** | Transformed `String`, transformed `String()`, or `Boolean` (for `ContainsOnlyNumericCharacters`) |
| **Primary components** | `TitleCaseExtensions.ToProperCase`, `TitleCaseExtensions.ToPadCapitalLetters`, `TitleCaseExtensions.ToLower`, `TitleCaseExtensions.ToUpper`, `TitleCaseExtensions.ContainsOnlyNumericCharacters`, `mdlTextConversion.ToSentenceCase` |
| **Entry point** | `Business\SAIF.Business.Utilities\TitleCase.vb`, `Business\SAIF.Business.Utilities\mdlTextConversion.vb` |

## Steps

1. **Proper-case a string.** `ToProperCase` calls `VB.StrConv(Target, VbStrConv.ProperCase)` and returns the result directly — no domain-specific word-list rules from [Title-case a string](title-case-a-string.md) are applied.
2. **Pad capital letters.** `ToPadCapitalLetters` checks whether `Target` already contains a space.
   - If it does: return `Target` unchanged. ([BR-006](../business-rules.md#br-006-capital-letter-padding-is-skipped-when-input-already-contains-a-space))
   - If it does not: delegate to `(New PadCapitalLettersFormat).ApplyFormat(Target)` to insert spaces before capital letters. `PadCapitalLettersFormat` is an external type not defined in this library; its formatting behavior could not be verified from this library's own source.**
3. **Convert an array to lowercase.** `ToLower(Target() As String)` projects every element of the array through `s.ToLower` and returns a new array.
4. **Convert an array to uppercase.** `ToUpper(Target() As String)` projects every element of the array through `s.ToUpper` and returns a new array.
5. **Check for numeric-only content.** `ContainsOnlyNumericCharacters` returns `True` only when `Target` is not `Nothing`, its trimmed length is greater than zero, and a regex match for a non-digit character (`\D`) finds no matches — i.e., every character in the (untrimmed) string is a digit.
6. **Sentence-case a string.** `ToSentenceCase` branches on the length of `Target`:
   - `Nothing`: return `Nothing`.
   - Length 0: return `Target` unchanged.
   - Length 1: return `Target.ToUpper`.
   - Length 2+: return the first character uppercased concatenated with the remaining characters lowercased.

## Process flow

The following diagram visualizes the independent branches for each of the five helper functions.

```mermaid
flowchart TD
	Start([Caller invokes a helper function]) --> Which{Which function?}
	Which -->|ToProperCase| Proper[StrConv ProperCase] --> DoneProper([Return proper-cased string])
	Which -->|ToPadCapitalLetters| PadCheck{Target contains a space?}
	PadCheck -->|Yes| PadSkip([Return Target unchanged])
	PadCheck -->|No| PadFormat[Delegate to external<br>PadCapitalLettersFormat.ApplyFormat]
	PadFormat --> DonePad([Return padded string])
	Which -->|ToLower array| ArrLower[Project each element ToLower] --> DoneLower([Return new lowercase array])
	Which -->|ToUpper array| ArrUpper[Project each element ToUpper] --> DoneUpper([Return new uppercase array])
	Which -->|ContainsOnlyNumericCharacters| NumCheck{Not Nothing, trimmed<br>length greater than 0,<br>no non-digit match?}
	NumCheck -->|Yes| NumTrue([Return True])
	NumCheck -->|No| NumFalse([Return False])
	Which -->|ToSentenceCase| SentLen{Target length?}
	SentLen -->|Nothing| SentNothing([Return Nothing])
	SentLen -->|0| SentEmpty([Return unchanged])
	SentLen -->|1| SentOne([Return uppercased])
	SentLen -->|2+| SentMulti([Return first char uppercased<br>plus remainder lowercased])
```

## Failure and edge-case behavior

- `ToPadCapitalLetters` never invokes the external `PadCapitalLettersFormat` type when the input already contains a space, so any behavior of that external type is exercised only on space-free input. ([BR-006](../business-rules.md#br-006-capital-letter-padding-is-skipped-when-input-already-contains-a-space))
- `ToPadCapitalLetters` does not null-check `Target` before calling `Target.Contains(" ")`; a `Nothing` input would raise a `NullReferenceException` rather than being handled gracefully.**
- `ContainsOnlyNumericCharacters` returns `False` (not an exception) for `Nothing` or blank input, distinguishing it from `ToPadCapitalLetters`'s lack of a null guard.
- `ToSentenceCase` is the only one of these five functions that explicitly handles a `Nothing` input by returning `Nothing` rather than throwing or returning an empty string.
- None of these five functions apply the word-list, prefix, or suffix rules used by [Title-case a string](title-case-a-string.md) ([BR-001](../business-rules.md#br-001-fixed-case-rendering-of-configured-abbreviations), [BR-003](../business-rules.md#br-003-already-mixed-case-words-bypass-title-casing), [BR-004](../business-rules.md#br-004-numeric-ordinal-words-bypass-word-list-casing), [BR-005](../business-rules.md#br-005-configured-possessive-suffixes-are-forced-to-fixed-casing)); they are simpler, independent transformations.

> **Note:** Statements marked with `*` were inferred from code structure, naming
> conventions, or contextual evidence where direct confirmation was not available
> in source artifacts. Statements marked with `**` could not be confirmed; treat
> as unknown until verified.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)

## Sources
- `Business\SAIF.Business.Utilities\TitleCase.vb`
- `Business\SAIF.Business.Utilities\mdlTextConversion.vb`
