|
各位大神们,小弟打算做一个东西,碰到一个难题:
比如以下文本:
a boy who was in my class at school
【a boy who was in my class at school】
What do you want to do when you leave school
【What do you want to do when you leave school】
我现在需要把中括号【】内的句子中所有空格去除,但是要保留第一个头一个句子不变。
即需要做成这个样子的:
a boy who was in my class at school
【aboywhowasinmyclassatschool】
What do you want to do when you leave school
【Whatdoyouwanttodowhenyouleaveschool】
请问该如何操作呢?有没有可能用正则表达式来查找替换?
或者有其他的编辑方法也行,请告诉我。
我知道中括号的样子很怪,但是,这种样式我另有用处。
当然,如果谁知道可以用不重复的随机数字编号来代替括号中的内容就更好了。
如这样
a boy who was in my class at school
【14231452】
What do you want to do when you leave school
【12456245】
|
|