StringHelper::endsWith PHP Method

endsWith() public method

public endsWith ( string $str ) : boolean
$str string
return boolean
    public function endsWith($str)
    {
        $sLen = mb_strlen($str);
        return mb_substr($this->value, $this->length - $sLen) == $str;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Prefix to apply to properties loaded using <code>file</code>.
  * A "." is appended to the prefix if not specified.
  * @param string $prefix prefix string
  * @return void
  * @since 2.0
  */
 function setPrefix($prefix)
 {
     $this->prefix = $prefix;
     if (!StringHelper::endsWith(".", $prefix)) {
         $this->prefix .= ".";
     }
 }
All Usage Examples Of StringHelper::endsWith