"Theerasak Photha" <[EMAIL PROTECTED]> 写于 2007-03-09 11:39:13: > > Suppose I want to replace "start" to "stop" without changing the > > capitalization, this will be: > > > > START -> STOP > > start -> stop > > > > My prior question is wrong, sorry. > > Oh, well in that case: > > :%s/START/STOP/g > :%/start/stop/g
This does not seem to be a good way, consider if we want to change: START -> STOP Start -> Stop start -> stop STart -> STop sTART -> sTOP ... then we may need to have too many lines... Or imagine if we need to change ABCDEFG into HIJKLMN: ABCDEFG -> HIJKLMN aBCDEFG -> hIJKLMN abCDEFG -> hiJKLMN abcDEFG -> hijKLMN ... how many lines should you write? write a function and change each character seem to be a more sensible approach. -- Sincerely, Pan, Shi Zhu. ext: 2606