Writing string to a file in java
I have a file which contains sql statements. Now in this file, I want to add a word "collate" after every 'char()开发者_Python百科' and 'varchar()' in the file. How do you do that?
Iterate through the file line by line. On each String do two replaceAll( ... ) using your Strings above. Then write each line into a new File. When done, rename the original file to some back-up name and rename the new file to the original file's name.
Edit 1
I just noticed your javascript
tag. So what type of problem is this, Java
or Javascript
?
精彩评论