Parse
  • Get started
    • Parser utilities for PHP
  • Request
    • HTTP Request input parser
    • Request SERVER vars
    • Request URL vars
    • Request GLOBAL vars
  • Route
    • Dispatch
  • Str
    • String parser
    • Initialise String
    • Case manipulators
    • Content slimmers
  • Dump
    • Output formatter
Powered by GitBook
On this page
  • trim(string $chars)
  • trimLeft(string $chars)
  • trimRight(string $chars)
  • trimInside()
  • slice( $start = 0, $length = null )
  1. Str

Content slimmers

Default trim chars. Custom chars can be provided where applicable.

  • white space

  • \n new line

  • \r carriage return

  • \t tab

  • \v vertical tab

  • \0 null character

trim(string $chars)

Trim the beginning and end of String.

Str::set('    Good morning  ')->trim(); // "Good morning"

trimLeft(string $chars)

Trim the beginning of String.

Str::set('    Good morning  ')->trim(); // "Good morning  "

trimRight(string $chars)

Trim the end of String.

Str::set('    Good morning  ')->trim(); // "    Good morning"

trimInside()

slice( $start = 0, $length = null )

PreviousCase manipulatorsNextOutput formatter

Last updated 2 years ago