How do I replace whitespaces with underscore?

前端 未结 13 2070

I want to replace whitespace with underscore in a string to create nice URLs. So that for example:

\"This should be connected\" becomes \"This_should_be_conn         


        
相关标签:
13条回答
  • 2020-11-29 16:39
    perl -e 'map { $on=$_; s/ /_/; rename($on, $_) or warn $!; } <*>;'
    

    Match et replace space > underscore of all files in current directory

    0 讨论(0)
提交回复
热议问题