生成字符串连接文本

2015-12-14 0 819
生成字符串连接文本
#!perl
use strict;
use warnings;
#原始字符串
my $src_str='select username,
				userid,
				deptid,
				roleid
				from user u,role r,dept d
				where u.deptid=d.id
				and u.roleid=r.id
				and u.userid=\'zhang\'';
#原始连接符
my $src_conn="\n";
#目标字符串标示符
my $target_quote='"';
#目标连接符
my $target_conn="+\n";

print join $target_conn,map {$target_quote.$_.$target_quote} split(/$src_conn/,$src_str);

遇见资源网 perl 生成字符串连接文本 http://www.ox520.com/13051.html

上一篇:

已经没有上一篇了!

下一篇:

已经没有下一篇了!

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务