'GT' 運算符在珀爾是用於檢查兩個字符串是否相等的字符串比較運算符之一。它用於檢查其左側的字符串是否按字符串順序大於其右側的字符串。
用法: String1 lt String2
返回:1 如果左參數大於右參數
示例 1:
#!/usr/local/bin/perl
# Initializing Strings
$a = "Welcome";
$b = "Geeks";
# Comparing the strings using gt operator
$c = $a gt $b;
if($c == 1)
{
print"String1 is greater than String2";
}
else
{
print"String1 is not greater than String2";
}
輸出:
String1 is greater than String2
示例 2:
#!/usr/local/bin/perl
# Initializing Strings
$a = "Geeks";
$b = "GeeksWelcome";
# Comparing the strings using gt operator
$c = $a gt $b;
if($c == 1)
{
print"String1 is greater than String2";
}
else
{
print"String1 is not greater than String2";
}
輸出:
String1 is not greater than String2
相關用法
- Perl getgrent用法及代碼示例
- Perl getgrgid用法及代碼示例
- Perl getgrnam用法及代碼示例
- Perl gethostbyaddr用法及代碼示例
- Perl gethostbyname用法及代碼示例
- Perl gethostent用法及代碼示例
- Perl getnetbyaddr用法及代碼示例
- Perl getnetbyname用法及代碼示例
- Perl getnetent用法及代碼示例
- Perl getpeername用法及代碼示例
- Perl getprotobyname用法及代碼示例
- Perl getprotobynumber用法及代碼示例
- Perl getprotoent用法及代碼示例
- Perl getpwent用法及代碼示例
- Perl getpwnam用法及代碼示例
- Perl getpwuid用法及代碼示例
- Perl getservbyname用法及代碼示例
- Perl getservbyport用法及代碼示例
- Perl getservent用法及代碼示例
- Perl getsockopt用法及代碼示例
- Perl glob用法及代碼示例
- Perl gmtime用法及代碼示例
- Perl goto用法及代碼示例
- Perl getc用法及代碼示例
- Perl glob()用法及代碼示例
注:本文由純淨天空篩選整理自Code_Mech大神的英文原創作品 Perl | gt operator。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。