Say I have some text like:

```
First one is good, so I used first one.Second one is bad, so I drop it.

```

I want to switch the 'first' and 'second',and like replace-string,leave the capital to the same case as original word.

Is there any built-in functions to handle this situations?

Edit:
Let me explain the problem further.If I use usual replace-string twice,will some times cause unwanted results.In the example above, If using replace-string first RET second RET, then replace-string second RET first RET,it will out put: First one is good. so I used first one.First one is bad, so I drop it. It also a problem in some case like "clientFolder=>serverFolder and server=> client"