faqts : Computers : Programming : Languages : Perl

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

8 of 9 people (89%) answered Yes
Recently 8 of 9 people (89%) answered Yes

Entry

How do you find the number of characters in a 'string' variable?

May 6th, 2008 09:38
Vishal Sharma, Colin Thomsen, Ankur Khandelwal,


Use the 'length' function. For example:
#!/usr/bin/perl -w
my $str = "some string";
print length($str) . "\n";
http://christmas-gifts-idea.blogspot.com/
http://uniquegiftsideas.blogspot.com/
http://valentinesdaygiftsidea.blogspot.com/