Toggle navigation
Hot Examples
DE
EN
RU
DE
FR
ES
PT
IT
JP
ZH
KO
PHP
PHP
C#
Java
Go
C++
Python
JS
TS
Suchen
Home
Stringy
Stringy
collapseWhitespace
Stringy\Stringy::collapseWhitespace PHP Method
Stringy Class Documentation
Datei anzeigen
Open project: danielstjules/stringy
collapseWhitespace()
public
method
Trims the string and replaces consecutive whitespace characters with a single space. This includes tabs and newline characters, as well as multibyte whitespace such as the thin space and ideographic space.
public
collapseWhitespace
( ) :
Stringy
return
Stringy
Object with a trimmed $str and condensed whitespace
public function collapseWhitespace() { return $this->regexReplace('[[:space:]]+', ' ')->trim(); }
Stringy
__construct
__toString
append
applyPadding
at
between
camelize
chars
charsArray
collapseWhitespace
contains
containsAll
containsAny
count
countSubstr
create
dasherize
delimit
endsWith
ensureLeft
ensureRight
eregReplace
first
getEncoding
getIterator
hasLowerCase
hasUpperCase
htmlDecode
htmlEncode
humanize
indexOf
indexOfLast
insert
isAlpha
isAlphanumeric
isBase64
isBlank
isHexadecimal
isJson
isLowerCase
isSerialized
isUpperCase
last
length
lines
longestCommonPrefix
longestCommonSubstring
longestCommonSuffix
lowerCaseFirst
matchesPattern
offsetExists
offsetGet
offsetSet
offsetUnset
pad
padBoth
padLeft
padRight
prepend
regexEncoding
regexReplace
removeLeft
removeRight
repeat
replace
reverse
safeTruncate
shuffle
slice
slugify
split
startsWith
substr
supportsEncoding
surround
swapCase
tidy
titleize
toAscii
toBoolean
toLowerCase
toSpaces
toTabs
toTitleCase
toUpperCase
trim
trimLeft
trimRight
truncate
underscored
upperCamelize
upperCaseFirst