Created
June 5, 2020 12:40
-
-
Save judavi/c4cbe017d944eca8eb80e4ec8ab8e0c1 to your computer and use it in GitHub Desktop.
Log golang Db query?
This file contains hidden or 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
package main | |
import ( | |
"regexp" | |
"fmt" | |
"strings" | |
) | |
func main() { | |
var re = regexp.MustCompile(`:\d`) | |
var str = `hola :1 esto es :1 digito y otro :2 asdkj :4 ` | |
for _, match := range re.FindAllString(str, -1) { | |
str= strings.Replace(str, match, `%s`, 1) | |
} | |
fmt.Println(str) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment