mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 15:54:29 +02:00
Tools (trim) added
This commit is contained in:
parent
bc8d769c73
commit
b8fde5e8f5
@ -856,6 +856,24 @@ sub clean_blank {
|
|||||||
return $input;
|
return $input;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Erase blank spaces before and after the string
|
||||||
|
################################################################################
|
||||||
|
sub trim {
|
||||||
|
my $string = shift;
|
||||||
|
if (is_empty($string)){
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
$string =~ s/\r//g;
|
||||||
|
|
||||||
|
chomp($string);
|
||||||
|
$string =~ s/^\s+//g;
|
||||||
|
$string =~ s/\s+$//g;
|
||||||
|
|
||||||
|
return $string;
|
||||||
|
}
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# sub sqlWrap(texto)
|
# sub sqlWrap(texto)
|
||||||
# Elimina comillas y caracteres problematicos y los sustituye por equivalentes
|
# Elimina comillas y caracteres problematicos y los sustituye por equivalentes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user