FreeKB - Perl (Scripting) Count characters in a string (length)
Perl (Scripting) - Count characters in a string (length)

The length operator can be used to determine the length of a string. In this example, string "Hello World" contains 11 characters (whitespace is a character).

my $string = "Hello World";
my $length = length($string);
print "$length\n";


Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter 49ce7 in the box below so that we can be sure you are a human.


Web design by yours truely - me, myself, and I   |   |