All snippets of the tag string |
|
21-30 of 33 Entries |
|
|
urldecode (Perl::Function) |
Created by Marko Schulz at 2008-12-27 03:38:48 |
# ***************************************
# This function decode an url.
sub urldecode {
my ($str) = shift;
$str =~ s/([^a-zA-Z0-9_.-])/sprintf("%%%02x", ord($1))/ge;
return $str;
} |
|
strim (PHP::Function) |
Created by Marko Schulz at 2008-12-27 03:10:25 |
// **************************************************************
// strim -- cut a string after X chars and append three points
//
// string strim( string string [, int length ] )
function strim ( $string, $length = 30 ) {
if ( strlen( $stri... |
|
filename (PHP::Function) |
Created by Marko Schulz at 2008-12-27 03:08:09 |
// **************************************************************
// filename -- extract the filename from file path
//
// string filename( string $str )
function filename ( $str ) {
if ( preg_match( '@([^\\\/]+)\?@', $str, $match ) or
pr... |
|
str_replace (Python::Function) |
Created by Marko Schulz at 2008-12-27 03:07:08 |
def str_replace( old, new, S ):
"""str_replace --- Return a copy of string S with all
occurrences of substring old replaced by new.
(string) string str_replace( (string) old, (string) new, (string) S )"""
return S.replace( old, n... |
|
ucwords (Python::Function) |
Created by Marko Schulz at 2008-12-27 02:47:18 |
def ucwords( string ):
"""ucwords -- Converts first letter of each word
within a string into an uppercase all other to lowercase.
(string) ucwords( (string) string )"""
erg=[ item.capitalize() for item in string.split( ' ' ) ]
... |
|
strim (Python::Function) |
Created by Marko Schulz at 2008-12-27 02:46:19 |
def strim( string, length=30 ):
"""strim -- cut a tring after X chars and append three points
(string) strim( (string) string [, (int) length ] )"""
if len(string) > length:
string = string[0:length] + "..."
return string |
|
filename (Python::Function) |
Created by Marko Schulz at 2008-12-27 02:45:18 |
def filename( file ):
"""filename -- extract the filename from file path
(string) filename( (string) file )"""
from re import compile, findall
if file.find('?') == -1:
regexp = compile('([^\\\\/]+)$')
else:
... |
|
ucwords (Perl::Function) |
Created by Marko Schulz at 2008-12-27 02:44:10 |
# **************************************************************
# ucwords -- Converts first letter of each word within a string
# into an uppercase all other to lowercase.
#
# string ucwords( string string )
sub ucwords {
my @array = spl... |
|
strim (Perl::Function) |
Created by Marko Schulz at 2008-12-27 02:43:02 |
# **************************************************************
# strim -- cut a string after X chars and append three points
#
# string strim( string string [, int length ] )
sub strim {
my ( $string, $length ) = @_;
$length = 30 if !$lengt... |
|
filename (Perl::Function) |
Created by Marko Schulz at 2008-12-27 02:41:55 |
# **************************************************************
# filename -- extract the filename from file path
#
# string filename( string string )
sub filename {
my $str=shift;
$str = $1 if ( $str =~ m!([^\\/]+)\?! || $str =~ m!([^\\/]+)... |
|
21-30 of 33 Entries |
|
|