且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何编写代码用文件中的逗号替换空格

更新时间:2022-12-11 07:49:26

例如,请参阅: SEARCH&替换 [ ^ ]。

例如

  


s = arun 36985;


s =〜s / /,/;
print


arun 36985
arrunav 25871
elarital 48734
depaal 43212
sujan 23467
my data is in this form i need to replace space with comma in perl script than how can i write the code for the above data

my data out put should be arun,36985
arrunav,25871
elarital,48734
depaal,43212
sujan,23467

See, for instance, here: SEARCH & REPLACE[^].
e.g.


s = "arun 36985";


s =~ s/ /,/; print