getkirby-v2 / toolkit

This is the deprecated toolkit for Kirby v2.
http://getkirby.com
81 stars 50 forks source link

str::after() with not-found needle omits first char #207

Closed sebsel closed 7 years ago

sebsel commented 7 years ago

So I had the following:

echo str::after('string', '.');
// tring

Maybe add a if (!$pos) return $string?

  public static function after($string, $char) {
    $pos = strpos($string, $char);
    return static::substr($string, $pos+1);
  }
bastianallgeier commented 7 years ago

This is now fixed on the develop branch.