File dsl/standard/String.class.php

Last commit: Thu Dec 26 12:12:43 2024 +0100	Jan Dankert	The last update from upstream repository openrat-cms.
1 <?php 2 3 4 namespace dsl\standard; 5 6 7 use dsl\context\BaseScriptableObject; 8 9 class String extends BaseScriptableObject 10 { 11 private $value; 12 13 /** 14 * Number constructor. 15 * @param $value 16 */ 17 public function __construct($value) 18 { 19 $this->value = $value; 20 } 21 22 public function __toString() 23 { 24 return $this->value; 25 } 26 27 28 public function __invoke( $value ) 29 { 30 return new String( $value ); 31 } 32 33 34 public function split( $splitChar = null ) { 35 if ( $splitChar == '' ) 36 return str_split( $this->value ); 37 if ( $splitChar == null ) 38 return array( $this->value ); 39 40 return explode( $splitChar, $this->value ); 41 } 42 43 44 public function trim() { 45 46 } 47 public function trimEnd() { 48 49 } 50 public function trimStart() { 51 52 } 53 public function valueOf() { 54 55 } 56 public function charAt() { 57 58 } 59 public function concat() { 60 61 } 62 public function endsWith() { 63 64 } 65 public function indexOf() { 66 67 } 68 public function lastIndexOf() { 69 70 } 71 public function padEnd( $length,$pad=null) { 72 73 } 74 public function padStart($length,$pad=null) { 75 76 } 77 public function repeat( $cound) { 78 79 } 80 public function replace() { 81 82 } 83 public function replaceAll() { 84 85 } 86 public function slice( $begin,$end=null) { 87 88 } 89 public function startsWith($search) { 90 91 } 92 public function substring( $start,$end) { 93 94 } 95 public function toLowerCase() { 96 97 } 98 public function toUpperCase() { 99 100 } 101 102 }
Download dsl/standard/String.class.php
History Thu, 26 Dec 2024 12:12:43 +0100 Jan Dankert The last update from upstream repository openrat-cms.