ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
TextData.php
Go to the documentation of this file.
1 <?php
2 
4 
6 
10 class TextData
11 {
23  public static function CHARACTER($character)
24  {
25  return TextData\CharacterConvert::character($character);
26  }
27 
39  public static function TRIMNONPRINTABLE($stringValue = '')
40  {
41  return TextData\Trim::nonPrintable($stringValue);
42  }
43 
55  public static function TRIMSPACES($stringValue = '')
56  {
57  return TextData\Trim::spaces($stringValue);
58  }
59 
71  public static function ASCIICODE($characters)
72  {
73  return TextData\CharacterConvert::code($characters);
74  }
75 
85  public static function CONCATENATE(...$args)
86  {
87  return TextData\Concatenate::CONCATENATE(...$args);
88  }
89 
107  public static function DOLLAR($value = 0, $decimals = 2)
108  {
109  return TextData\Format::DOLLAR($value, $decimals);
110  }
111 
125  public static function SEARCHSENSITIVE($needle, $haystack, $offset = 1)
126  {
127  return TextData\Search::sensitive($needle, $haystack, $offset);
128  }
129 
143  public static function SEARCHINSENSITIVE($needle, $haystack, $offset = 1)
144  {
145  return TextData\Search::insensitive($needle, $haystack, $offset);
146  }
147 
161  public static function FIXEDFORMAT($value, $decimals = 2, $no_commas = false)
162  {
163  return TextData\Format::FIXEDFORMAT($value, $decimals, $no_commas);
164  }
165 
178  public static function LEFT($value = '', $chars = 1)
179  {
180  return TextData\Extract::left($value, $chars);
181  }
182 
196  public static function MID($value = '', $start = 1, $chars = null)
197  {
198  return TextData\Extract::mid($value, $start, $chars);
199  }
200 
213  public static function RIGHT($value = '', $chars = 1)
214  {
215  return TextData\Extract::right($value, $chars);
216  }
217 
229  public static function STRINGLENGTH($value = '')
230  {
231  return TextData\Text::length($value);
232  }
233 
247  public static function LOWERCASE($mixedCaseString)
248  {
249  return TextData\CaseConvert::lower($mixedCaseString);
250  }
251 
265  public static function UPPERCASE($mixedCaseString)
266  {
267  return TextData\CaseConvert::upper($mixedCaseString);
268  }
269 
283  public static function PROPERCASE($mixedCaseString)
284  {
285  return TextData\CaseConvert::proper($mixedCaseString);
286  }
287 
302  public static function REPLACE($oldText, $start, $chars, $newText)
303  {
304  return TextData\Replace::replace($oldText, $start, $chars, $newText);
305  }
306 
321  public static function SUBSTITUTE($text = '', $fromText = '', $toText = '', $instance = 0)
322  {
323  return TextData\Replace::substitute($text, $fromText, $toText, $instance);
324  }
325 
337  public static function RETURNSTRING($testValue = '')
338  {
339  return TextData\Text::test($testValue);
340  }
341 
354  public static function TEXTFORMAT($value, $format)
355  {
356  return TextData\Format::TEXTFORMAT($value, $format);
357  }
358 
370  public static function VALUE($value = '')
371  {
372  return TextData\Format::VALUE($value);
373  }
374 
388  public static function NUMBERVALUE($value = '', $decimalSeparator = null, $groupSeparator = null)
389  {
390  return TextData\Format::NUMBERVALUE($value, $decimalSeparator, $groupSeparator);
391  }
392 
407  public static function EXACT($value1, $value2)
408  {
409  return TextData\Text::exact($value1, $value2);
410  }
411 
425  public static function TEXTJOIN($delimiter, $ignoreEmpty, ...$args)
426  {
427  return TextData\Concatenate::TEXTJOIN($delimiter, $ignoreEmpty, ...$args);
428  }
429 
444  public static function builtinREPT($str, $number)
445  {
446  return TextData\Concatenate::builtinREPT($str, $number);
447  }
448 }
static insensitive($needle, $haystack, $offset=1)
SEARCHINSENSITIVE.
Definition: Search.php:55
static mid($value='', $start=1, $chars=null)
MID.
Definition: Extract.php:39
static nonPrintable($stringValue='')
TRIMNONPRINTABLE.
Definition: Trim.php:19
static DOLLAR($value=0, $decimals=2)
DOLLAR.
Definition: Format.php:26
static PROPERCASE($mixedCaseString)
PROPERCASE.
Definition: TextData.php:283
static UPPERCASE($mixedCaseString)
UPPERCASE.
Definition: TextData.php:265
static NUMBERVALUE($value='', $decimalSeparator=null, $groupSeparator=null)
NUMBERVALUE.
Definition: Format.php:162
static builtinREPT($stringValue, $repeatCount)
REPT.
Definition: Concatenate.php:59
$format
Definition: metadata.php:141
static STRINGLENGTH($value='')
STRINGLENGTH.
Definition: TextData.php:229
$delimiter
Definition: showstats.php:16
static RIGHT($value='', $chars=1)
RIGHT.
Definition: TextData.php:213
static TRIMSPACES($stringValue='')
TRIMSPACES.
Definition: TextData.php:55
static MID($value='', $start=1, $chars=null)
MID.
Definition: TextData.php:196
static SUBSTITUTE($text='', $fromText='', $toText='', $instance=0)
SUBSTITUTE.
Definition: TextData.php:321
static SEARCHSENSITIVE($needle, $haystack, $offset=1)
SEARCHSENSITIVE.
Definition: TextData.php:125
static TEXTJOIN($delimiter, $ignoreEmpty,... $args)
TEXTJOIN.
Definition: Concatenate.php:36
static left($value='', $chars=1)
LEFT.
Definition: Extract.php:16
static ASCIICODE($characters)
ASCIICODE.
Definition: TextData.php:71
$start
Definition: bench.php:8
static LEFT($value='', $chars=1)
LEFT.
Definition: TextData.php:178
static right($value='', $chars=1)
RIGHT.
Definition: Extract.php:62
static NUMBERVALUE($value='', $decimalSeparator=null, $groupSeparator=null)
NUMBERVALUE.
Definition: TextData.php:388
static CONCATENATE(... $args)
CONCATENATE.
Definition: TextData.php:85
static TEXTFORMAT($value, $format)
TEXTFORMAT.
Definition: TextData.php:354
static CHARACTER($character)
CHARACTER.
Definition: TextData.php:23
static RETURNSTRING($testValue='')
RETURNSTRING.
Definition: TextData.php:337
$text
Definition: errorreport.php:18
static sensitive($needle, $haystack, $offset=1)
SEARCHSENSITIVE.
Definition: Search.php:20
static TEXTFORMAT($value, $format)
TEXTFORMAT.
Definition: Format.php:95
static FIXEDFORMAT($value, $decimals=2, $no_commas=false)
FIXEDFORMAT.
Definition: TextData.php:161
static FIXEDFORMAT($value, $decimals=2, $noCommas=false)
FIXEDFORMAT.
Definition: Format.php:59
static substitute($text='', $fromText='', $toText='', $instance=0)
SUBSTITUTE.
Definition: Replace.php:38
static test($testValue='')
RETURNSTRING.
Definition: Text.php:49
static builtinREPT($str, $number)
REPT.
Definition: TextData.php:444
static length($value='')
STRINGLENGTH.
Definition: Text.php:15
static exact($value1, $value2)
Compares two text strings and returns TRUE if they are exactly the same, FALSE otherwise.
Definition: Text.php:34
static spaces($stringValue='')
TRIMSPACES.
Definition: Trim.php:45
static replace($oldText, $start, $chars, $newText)
REPLACE.
Definition: Replace.php:17
static SEARCHINSENSITIVE($needle, $haystack, $offset=1)
SEARCHINSENSITIVE.
Definition: TextData.php:143
static LOWERCASE($mixedCaseString)
LOWERCASE.
Definition: TextData.php:247
static DOLLAR($value=0, $decimals=2)
DOLLAR.
Definition: TextData.php:107
static REPLACE($oldText, $start, $chars, $newText)
REPLACE.
Definition: TextData.php:302
static EXACT($value1, $value2)
Compares two text strings and returns TRUE if they are exactly the same, FALSE otherwise.
Definition: TextData.php:407
static TRIMNONPRINTABLE($stringValue='')
TRIMNONPRINTABLE.
Definition: TextData.php:39
static TEXTJOIN($delimiter, $ignoreEmpty,... $args)
TEXTJOIN.
Definition: TextData.php:425