PluginProbe
wpDataTables – WordPress Data Table, Dynamic Tables & Table Charts Plugin / 6.5.1.7
wpDataTables – WordPress Data Table, Dynamic Tables & Table Charts Plugin v6.5.1.7
6.5.1.7 6.5.1.6 6.5.1.5 6.5.1.4 6.5.1.3 6.5.1.2 6.5.1.1 6.5.0.9 6.5.0.8 6.5.0.7 6.5.0.6 trunk 3.4.2.40 3.4.2.41 3.4.2.42 3.4.2.43 3.4.2.44 3.4.2.45 3.4.2.46 3.4.2.47 3.4.2.48 3.4.2.49 3.4.2.50 6.3.2 6.3.3.1 All 47 releases
wpdatatables / lib / phpoffice / phpspreadsheet / src / PhpSpreadsheet / Calculation / TextData / Trim.php

Trim.php in wpDataTables – WordPress Data Table, Dynamic Tables & Table Charts Plugin 6.5.1.7, at lib/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Trim.php

53 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace PhpOffice\PhpSpreadsheet\Calculation\TextData;
4
5 use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled;
6
7 class Trim
8 {
9 use ArrayEnabled;
10
11 /**
12 * CLEAN.
13 *
14 * @param mixed $stringValue String Value to check
15 * Or can be an array of values
16 *
17 * @return array|string
18 * If an array of values is passed as the argument, then the returned result will also be an array
19 * with the same dimensions
20 */
21 public static function nonPrintable($stringValue = '')
22 {
23 if (is_array($stringValue)) {
24 return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $stringValue);
25 }
26
27 $stringValue = Helpers::extractString($stringValue);
28
29 return (string) preg_replace('/[\x00-\x1f]/', '', "$stringValue");
30 }
31
32 /**
33 * TRIM.
34 *
35 * @param mixed $stringValue String Value to check
36 * Or can be an array of values
37 *
38 * @return array|string
39 * If an array of values is passed as the argument, then the returned result will also be an array
40 * with the same dimensions
41 */
42 public static function spaces($stringValue = '')
43 {
44 if (is_array($stringValue)) {
45 return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $stringValue);
46 }
47
48 $stringValue = Helpers::extractString($stringValue);
49
50 return trim(preg_replace('/ +/', ' ', trim("$stringValue", ' ')) ?? '', ' ');
51 }
52 }
53