【发布时间】:2013-05-13 16:12:32
【问题描述】:
我需要在 Perl 中创建一个子程序来确定字符串是否以大写字符开头。到目前为止,我有以下内容:
sub checkCase {
if ($_[0] =~ /^[A-Z]/) {
return 1;
}
else {
return 0;
}
}
$result1 = $checkCase("Hello");
$result2 = $checkCase("world");
【问题讨论】:
-
...和?怎么不工作了?
-
意思是来自 ASCII 的大写字母?或unicode大写字母或大写代码点?
标签: perl case-sensitive uppercase