Monday, November 17, 2014

Regular expression for the file name without extension in Groovy

Are you willing to get rid on the file extension in groovy, but don't know how to do that ? This post is for you. If you are a programmer, you will not certainly want to read many useless lines before getting what you.
This line is for you:

file.name.replaceFirst(~/\.[^\.]+$/, '')
 
All credits go to Nikita 

Namaste

No comments:

Post a Comment