How to write a ruby regex that removes characters only at first and last positions?
I have a log file, most lines are quoted at first and last character, like:
"2010-09-09,13:33,"user logoff",0"
What's the ruby regex to remove the head and tail quotation marks? so the result string looks like:
开发者_JAVA技巧 2010-09-09,13:33,"user logoff",0
str.gsub /^"|"$/, ''
Or without regular expressions:
string[1...-1]
精彩评论