remove() публичный статический Метод

Example: $string = 'winter is coming???!!!'; $result = Strings::remove($string, '???'); Result: winter is coming!!!
public static remove ( string $string, string $toRemove ) : mixed
$string string
$toRemove string
Результат mixed
Пример #1
0
function addFile(array $fileInfo = array(), $stringToRemove = '')
{
    if (!empty($fileInfo)) {
        $prefixSystem = Config::getValue('global', 'prefix_system');
        $suffixCache = Config::getValue('global', 'suffix_cache');
        $suffixCache = !empty($suffixCache) ? '?' . $suffixCache : '';
        $url = $prefixSystem . $fileInfo['params']['url'] . $suffixCache;
        $url = Strings::remove($url, $stringToRemove);
        return _getHtmlFileTag($fileInfo['type'], $url);
    }
    return null;
}
Пример #2
0
 /**
  * @test
  */
 public function shouldRemovePartOfString()
 {
     //given
     $string = 'winter is coming???!!!';
     //when
     $result = Strings::remove($string, '???');
     //then
     $this->assertEquals('winter is coming!!!', $result);
 }
Пример #3
0
 public function getTab()
 {
     $noController = Strings::remove(get_called_class(), 'Controller');
     $noSlashes = Strings::remove($noController, '\\');
     return Strings::camelCaseToUnderscore($noSlashes);
 }