ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
Trim.php
Go to the documentation of this file.
1
<?
php
2
3
namespace
PhpOffice\PhpSpreadsheet\Calculation\TextData
;
4
5
use
PhpOffice\PhpSpreadsheet\Calculation\Calculation
;
6
use
PhpOffice\PhpSpreadsheet\Calculation\Functions
;
7
8
class
Trim
9
{
10
private
static
$invalidChars
;
11
19
public
static
function
nonPrintable
($stringValue =
''
)
20
{
21
$stringValue =
Functions::flattenSingleValue
($stringValue);
22
23
if
(is_bool($stringValue)) {
24
return
($stringValue) ?
Calculation::getTRUE
() :
Calculation::getFALSE
();
25
}
26
27
if
(self::$invalidChars === null) {
28
self::$invalidChars = range(chr(0), chr(31));
29
}
30
31
if
(is_string($stringValue) || is_numeric($stringValue)) {
32
return
str_replace(self::$invalidChars,
''
, trim($stringValue,
"\x00..\x1F"
));
33
}
34
35
return
null;
36
}
37
45
public
static
function
spaces
($stringValue =
''
)
46
{
47
$stringValue =
Functions::flattenSingleValue
($stringValue);
48
if
(is_bool($stringValue)) {
49
return
($stringValue) ?
Calculation::getTRUE
() :
Calculation::getFALSE
();
50
}
51
52
if
(is_string($stringValue) || is_numeric($stringValue)) {
53
return
trim(preg_replace(
'/ +/'
,
' '
, trim($stringValue,
' '
)),
' '
);
54
}
55
56
return
null;
57
}
58
}
PhpOffice\PhpSpreadsheet\Calculation\TextData\Trim\nonPrintable
static nonPrintable($stringValue='')
TRIMNONPRINTABLE.
Definition:
Trim.php:19
PhpOffice\PhpSpreadsheet\Calculation\TextData
Definition:
CaseConvert.php:3
PhpOffice\PhpSpreadsheet\Calculation\TextData\Trim\$invalidChars
static $invalidChars
Definition:
Trim.php:10
Calculation
PhpOffice\PhpSpreadsheet\Calculation\Calculation\getFALSE
static getFALSE()
Return the locale-specific translation of FALSE.
Definition:
Calculation.php:2844
PhpOffice\PhpSpreadsheet\Calculation\Calculation\getTRUE
static getTRUE()
Return the locale-specific translation of TRUE.
Definition:
Calculation.php:2834
PhpOffice\PhpSpreadsheet\Calculation\TextData\Trim
Definition:
Trim.php:8
PhpOffice\PhpSpreadsheet\Calculation\TextData\Trim\spaces
static spaces($stringValue='')
TRIMSPACES.
Definition:
Trim.php:45
Functions
php
PhpOffice\PhpSpreadsheet\Calculation\Functions\flattenSingleValue
static flattenSingleValue($value='')
Convert an array to a single scalar value by extracting the first element.
Definition:
Functions.php:649
libs
composer
vendor
phpoffice
phpspreadsheet
src
PhpSpreadsheet
Calculation
TextData
Trim.php
Generated on Thu Feb 27 2025 19:01:24 for ILIAS by
1.8.13 (using
Doxyfile
)