Tools (trim) added
This commit is contained in:
parent
bc8d769c73
commit
b8fde5e8f5
|
@ -856,6 +856,24 @@ sub clean_blank {
|
|||
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)
|
||||
# Elimina comillas y caracteres problematicos y los sustituye por equivalentes
|
||||
|
|
Loading…
Reference in New Issue