Skip to content
This repository has been archived by the owner on Oct 29, 2023. It is now read-only.

Commit

Permalink
removed duplicate methods from String class
Browse files Browse the repository at this point in the history
  • Loading branch information
juzna committed Mar 19, 2011
1 parent 9976d14 commit 5b7e8f2
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions app/classes/string.php
Expand Up @@ -25,10 +25,6 @@ public static function uncamelize($str) {
return preg_replace('/(?<=[a-z])([A-Z])/e', "'-' . strtolower('\\1')", $str);
}

public static function startsWith($haystack, $needle) {
return strncmp($haystack, $needle, strlen($needle)) === 0;
}

static function isFalse($val) {
return (!$val || $val == 'false' || $val == 'no');
}
Expand All @@ -50,18 +46,6 @@ static function getFirstLine($text) {
return trim($pos ? substr($text, 0, $pos) : $text, "\r");
}

/**
* Generate string of random characters
* @param int $len
* @return string
*/
static function random__($len) {
static $z = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
$slen = strlen($z) - 1;
for($s = ""; $len > 0; $len--) $s .= substr($z, rand(0, $slen), 1);
return $s;
}

/**
* Implode using printf formatting
* @param string $glue Glue for implode
Expand Down

0 comments on commit 5b7e8f2

Please sign in to comment.