Skip to content

Function.swapCase

github-actions[bot] edited this page Jun 11, 2026 · 21 revisions

umt / swapCase

Function: swapCase()

swapCase(string_): string

Defined in: String/swapCase.ts:9

Swaps the case of each letter in a string, turning uppercase letters into lowercase and vice versa. Characters without case are left unchanged.

Parameters

string_

string

Input string

Returns

string

String with swapped case

Example

swapCase("Hello World"); // "hELLO wORLD"

API

Classes

Interfaces

Type Aliases

Variables

Functions

Clone this wiki locally