文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>join and split

join and split

时间:2005-04-20  来源:寂寞烈火

join用于将表中的元素连接成串,split是串拆分成表

join语法:
join EXPR,LIST
如:
/home/lee#perl -e 'print ("a","b","c");print " "'
abc
/home/lee#perl -e 'print join("=>","a","b","c");print " "'
a=>b=>c
/home/lee#perl -e 'print join(":","a","b","c");print " "'
a:b:c
join函数让EXPR中的值包围着LIST里的串,然后返回整个串!EXPR也可以拥有多个字符!

split语法:
split
split /PATTERN/
split /PATTERN/,EXPR
split /PATTERN/,EXPR,LIST
这里,split函数在串PATTERN出现的每个地方将串EXPR分开.例子:
/home/lee#perl -e 'print ((split " ","hello world")[1]);print " "'
world

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载