'其' 運算符在珀爾是用於檢查兩個字符串是否相等的字符串比較運算符之一。它用於檢查其左側的字符串是否小於其右側的字符串。
用法: String1 lt String2
返回:1 如果左參數小於右參數
示例 1:
#!/usr/local/bin/perl
# Initializing Strings
$a = "Geeks";
$b = "Welcome";
# Comparing the strings using lt operator
$c = $a lt $b;
if($c == 1)
{
print"String1 is less than String2";
}
else
{
print"String1 is not less than String2";
}
輸出:
String1 is less than String2
示例 2:
#!/usr/local/bin/perl
# Initializing Strings
$a = "GeeksWelcome";
$b = "Geeks";
# Comparing the strings using lt operator
$c = $a lt $b;
if($c == 1)
{
print"String1 is less than String2";
}
else
{
print"String1 is not less than String2";
}
輸出:
String1 is not less than String2
相關用法
- Perl last用法及代碼示例
- Perl length用法及代碼示例
- Perl link用法及代碼示例
- Perl listen用法及代碼示例
- Perl local用法及代碼示例
- Perl localtime用法及代碼示例
- Perl log用法及代碼示例
- Perl lstat用法及代碼示例
- Perl lcfirst()用法及代碼示例
- Perl log()用法及代碼示例
- Perl length()用法及代碼示例
- Perl le用法及代碼示例
- Perl abs用法及代碼示例
- Perl alarm用法及代碼示例
- Perl bless用法及代碼示例
- Perl caller用法及代碼示例
- Perl chmod用法及代碼示例
- Perl chomp用法及代碼示例
- Perl chop用法及代碼示例
- Perl chr用法及代碼示例
- Perl continue用法及代碼示例
- Perl crypt用法及代碼示例
- Perl dbmclose用法及代碼示例
- Perl dbmopen用法及代碼示例
- Perl defined用法及代碼示例
注:本文由純淨天空篩選整理自Code_Mech大神的英文原創作品 Perl | lt operator。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。