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

Updated:   |  Perl (Scripting) articles

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";

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


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