Trim

str_trim

Strip leading and trailing whitespace from a string and print the result.

Arguments

  • ... (string): The input string

Exit codes

  • 0: Always

Output on stdout

  • Input string with leading and trailing whitespace removed

trim

Alias for str_trim.

str_strip

Alias for str_trim.

strip

Alias for str_trim.

str_ltrim

Strip leading whitespace from a string and print the result.

Arguments

  • ... (string): The input string

Exit codes

  • 0: Always

Output on stdout

  • Input string with leading whitespace removed

ltrim

Alias for str_ltrim.

str_ntrim

Strip leading and trailing whitespace and compact internal spaces, printing the result to stdout.

Arguments

  • ... (string): The input string

Exit codes

  • 0: Always

Output on stdout

  • Trimmed and compacted string

ntrim

Alias for str_ntrim.

str_rtrim

Strip trailing whitespace from a string and print the result.

Arguments

  • ... (string): The input string

Exit codes

  • 0: Always

Output on stdout

  • Input string with trailing whitespace removed

rtrim

Alias for str_rtrim.