博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
详解Perl字符串比较和整数比较的区别
阅读量:2717 次
发布时间:2019-05-13

本文共 418 字,大约阅读时间需要 1 分钟。

本文向大家介绍一下Perl字符串比较和整数比较.
Perl语言中Perl字符串可分为单引号和双引号字符串,那么如何进行Perl字符串比较呢,
请看本文详细介绍:
本文和大家重点讨论一下Perl字符串比较和整数比较,
算术运算符的比较有大于,小于,等于,不等于等关系,
而Perl字符串比较也不例外,
这里向大家详细介绍一下:
一. 字符串比较操作符
操作符  描述 
lt            小于 
gt          大于 
eq         等于 
le          小于等于 
ge        大于等于 
ne         不等于 
cmp     比较, 返回1,0,or-1
 
二. 整数比较操作符
操作符  描述
<            小于
>            大于
==          等于
<=          小于等于
>=          大于等于
!=           不等于
<=>       比较,返回1, 0, or -1
PS:
整数比较操作符是数值比较,
使用时会把左右操作数都转化为数字。
原文链接:
http://developer.51cto.com/art/201007/211632.htm

转载地址:http://unctd.baihongyu.com/

你可能感兴趣的文章
≪统计学习精要(The Elements of Statistical Learning)≫课堂笔记(三)
查看>>
≪统计学习精要(The Elements of Statistical Learning)≫课堂笔记(四)
查看>>
≪统计学习精要(The Elements of Statistical Learning)≫课堂笔记(五)
查看>>
≪统计学习精要(The Elements of Statistical Learning)≫课堂笔记(六)
查看>>
≪统计学习精要(The Elements of Statistical Learning)≫课堂笔记(七)
查看>>
≪统计学习精要(The Elements of Statistical Learning)≫课堂笔记(八)
查看>>
≪统计学习精要(The Elements of Statistical Learning)≫课堂笔记(九)
查看>>
≪统计学习精要(The Elements of Statistical Learning)≫课堂笔记(十)
查看>>
≪统计学习精要(The Elements of Statistical Learning)≫课堂笔记(十一)
查看>>
≪统计学习精要(The Elements of Statistical Learning)≫课堂笔记(十二)
查看>>
≪统计学习精要(The Elements of Statistical Learning)≫课堂笔记(十三)
查看>>
≪统计学习精要(The Elements of Statistical Learning)≫课堂笔记(十四)
查看>>
≪统计学习精要(The Elements of Statistical Learning)≫课堂笔记(十五)
查看>>
≪统计学习精要(The Elements of Statistical Learning)≫课堂笔记(十六)
查看>>
≪统计学习精要(The Elements of Statistical Learning)≫课堂笔记(十八):神经网络
查看>>
≪统计学习精要(The Elements of Statistical Learning)≫课堂笔记(十九):SVM
查看>>
统计学习精要(The Elements of Statistical Learning)课堂笔记(二十一):SMO算法
查看>>
统计学习精要(The Elements of Statistical Learning)课堂笔记(二十二):核函数和核方法
查看>>
统计学习精要(The Elements of Statistical Learning)课堂笔记(二十三):原型方法和最近邻KNN
查看>>
统计学习精要(The Elements of Statistical Learning)课堂笔记(二十四):聚类
查看>>