Exemplo n.º 1
0
 /**
  * This method returns an array list of substrings that were delimited by the specified
  * delimiter.
  *
  * @access public
  * @static
  * @param IString\Type $xs                                   the delimiter
  * @param IString\Type $ys                                   the string to be exploded
  * @return IArrayList\Type                                   the array list of substrings
  */
 public static function split(IString\Type $xs, IString\Type $ys)
 {
     $zs = explode($xs->unbox(), $ys->unbox());
     return IArrayList\Type::box(array_map(function ($z) : IString\Type {
         return IString\Type::box($z);
     }, $zs));
 }
Exemplo n.º 2
0
 /**
  * This method compares the specified object with the current object for order.
  *
  * @access public
  * @static
  * @param IString\Type $xs                                  the left operand
  * @param IString\Type $ys                                  the object to be compared
  * @return ITrit\Type                                       whether the current object is less than,
  *                                                          equal to, or greater than the specified
  *                                                          object
  */
 public static function compare(IString\Type $xs, IString\Type $ys) : ITrit\Type
 {
     return ITrit\Type::make(strcmp($xs->unbox(), $ys->unbox()));
 }
Exemplo n.º 3
0
 /**
  * This method allows for the class to be extend with custom utility functions.
  *
  * @access public
  * @static
  * @param IString\Type $name                                 the name of the mixin
  * @param callable $closure                                 the custom utility function
  */
 public static function mixin(IString\Type $name, callable $closure)
 {
     static::$mixins[$name->unbox()] = $closure;
 }