Skip to content

Latest commit

 

History

History
66 lines (35 loc) · 1.37 KB

strings.md

File metadata and controls

66 lines (35 loc) · 1.37 KB
title
Strings

String

Strip leading and trailing whitespace from a string

Problem

You want to remove unwated characters, such as whitespace, newline etc., from the beginning or end of a string.

Solution

The default strip procedure will remove whitespaces both both ends. However, you can strip characters from only one end by using trailing=false and leading=false parameters.

You can specify more than one character to strip from the string (default: whitespace) by passing in a set of characers.

Note the (* and *) stripped from the ends and not from the middle of the string.

Interpolating variables in Strings

Problem

Create a string in which variable values can be embedded.

Solution

Check the case of a string

Problem

Check if a string is an uppercase or a lowercase.

Solution

Change the case of a string

Problem

You need to change the case of a string to upper, lower, or to a sentence case (only first letter is upper).

Solution