Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 845 Bytes

format-space.pipe.md

File metadata and controls

32 lines (23 loc) · 845 Bytes
Title Added Status Last reviewed
Format Space pipe
v3.0.0
Active
2018-11-27

Replaces all the white space in a string with a supplied character.

Basic Usage

<div [id]="'CHECK MY ID' | formatSpace">
    BATTLESTAR GALACTICA
</div>

Details

The pipe replaces each run of whitespace characters in the string with a single character (which is the underscore by default) and transforms the string to lowercase (eg, test a pipe becomes test_a_pipe).

You can specify a different replacement character by passing it as a pipe parameter. You can also pass false to the lowercase parameter to skip the conversion to lowercase and just replace the whitespace.