Bonjour,
Quelqu'un pourrait-il m'aider à traduire cette fonction perl en language PHP ? Merci pour votre aide!!
sub long_string {
my $str = shift;
my $limit = 255;
# Return short strings
return $str if length $str <= $limit;
# Split the line at word boundaries where possible
my @segments = $str =~ m[.{1,$limit}$|.{1,$limit}\b|.{1,$limit}]sog;
# Join the string back together with quotes and Excel concatenation
$str = join '"&"', @segments;
# Add formatting to convert the string to a formula string
return $str = qq(="$str");
}
Configuration: Windows XP Internet Explorer 7.0