2021 Christmas BiNgO
Choose a snippet. The answer is the runtime in "big O" notation.
help wanted!
This challenge is in alpha phase. Please submit me a new snippet+solution in private. The language of your own snippet does not matter.
A code snippet
GeSHi`ed PHP code for
"string_utility2.php" 1
2
3
4
56
7
8
9
1011
12
13
14
1516
17
18
| <?php
/**
* Take the string after/from a string. You can nibble tokens with that. slow?
*
* @param string $s * @param string $from
* @param string $default
* @return string
*/
function substrFrom($s, $from, $default=null){
if (false !== ($index = strpos($s, $from)))
{
return substr($s, $index + strlen($from));
} return $default;
}
|
© 2024 by