Created
February 16, 2020 23:47
-
-
Save gokaybiz/e8714b78e810df9d693ab8bc22634546 to your computer and use it in GitHub Desktop.
Add suffix between file name and extensions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func fileNameRename(fileName, suffix string) (newFName string) { | |
exts := strings.Split(fileName, ".") | |
newFName = exts[0] + "_" + suffix + fileName[len(fileName[0:len(exts[0])]):] | |
return | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment