1 |
## --------------------------------------------------------------------------- |
## ------------------------------------------------------------------------- |
2 |
## $Id$ |
## $Id$ |
3 |
## --------------------------------------------------------------------------- |
## ------------------------------------------------------------------------- |
4 |
## $Log$ |
## $Log$ |
5 |
|
## Revision 1.4 2003/02/21 08:37:25 joko |
6 |
|
## minor fix |
7 |
|
## |
8 |
|
## Revision 1.3 2003/02/20 21:23:34 joko |
9 |
|
## using 'trim_space' from Pitonyak::StringUtil as a replacement for our 'trim' |
10 |
|
## |
11 |
## Revision 1.2 2003/01/31 01:22:19 root |
## Revision 1.2 2003/01/31 01:22:19 root |
12 |
## + sub getLastPart |
## + sub getLastPart |
13 |
## |
## |
14 |
## Revision 1.1 2003/01/19 03:27:36 joko |
## Revision 1.1 2003/01/19 03:27:36 joko |
15 |
## + initial check-in |
## + initial check-in |
16 |
## |
## ------------------------------------------------------------------------- |
|
## --------------------------------------------------------------------------- |
|
17 |
|
|
18 |
|
|
19 |
package Data::Transform::String; |
package Data::Transform::String; |
24 |
require Exporter; |
require Exporter; |
25 |
our @ISA = qw( Exporter ); |
our @ISA = qw( Exporter ); |
26 |
our @EXPORT_OK = qw( |
our @EXPORT_OK = qw( |
27 |
stripHtml stripSpaces stripNewLines toReal trim getLastPart |
stripHtml stripNewLines toReal getLastPart trim |
28 |
); |
); |
29 |
|
|
30 |
|
|
31 |
|
use Pitonyak::StringUtil qw( trim_space ); |
32 |
|
|
33 |
sub stripHtml { |
sub stripHtml { |
34 |
my $html = shift; |
my $html = shift; |
35 |
my $result = ''; |
my $result = ''; |
47 |
return $result; |
return $result; |
48 |
} |
} |
49 |
|
|
|
sub stripSpaces { |
|
|
my $text = shift; |
|
|
#print "text: $text", "\n"; |
|
|
#print "ord: ", ord(substr($text, 0, 1)), "\n"; |
|
|
$text =~ s/^\s*//g; |
|
|
$text =~ s/\s*$//g; |
|
|
return $text; |
|
|
} |
|
|
|
|
50 |
sub trim { |
sub trim { |
51 |
my $string = shift; |
trim_space(@_); |
|
return stripSpaces($string); |
|
52 |
} |
} |
53 |
|
|
54 |
sub stripNewLines { |
sub stripNewLines { |