
ahfeii
Novice
Jan 15, 2013, 6:05 PM
Post #1 of 4
(2018 views)
|
length() does not count square brackets as 2 chatacters
|
Can't Post
|
|
Dear Sir/Madam, I have a string: $string = "Hello [Alfred], how are you?"; print length($string); // result: 28 The result supposes to be 30, because [ and ] considered as 2 characters each as both [ and ] are the extended characters in GSM format. May I know is there any perl functions can count characters more efficiently? Or I should create my own function personally?
|