Re: [go-nuts] Remove digits from string

2022-12-30 Thread peterGo
Brian, The Bikeshed email http://phk.freebsd.dk/sagas/bikeshed/ Regular Expressions: Now You Have Two Problems https://blog.codinghorror.com/regular-expressions-now-you-have-two-problems/ MustCompile is like Compile but panics if the expression cannot be parsed. I

Re: [go-nuts] Remove digits from string

2022-12-30 Thread Brian Candler
https://go.dev/play/p/WxKPohZhbrE On Thursday, 29 December 2022 at 22:12:47 UTC peterGo wrote: > https://go.dev/play/p/F6gNFWjRzGO > > > On Thursday, December 29, 2022 at 12:50:34 PM UTC-5 Mitul sharma wrote: > >> Hello, >> >> I'm stuck in below code snippet, looking to have a output as string

Re: [go-nuts] Remove digits from string

2022-12-29 Thread peterGo
https://go.dev/play/p/F6gNFWjRzGO On Thursday, December 29, 2022 at 12:50:34 PM UTC-5 Mitul sharma wrote: > Hello, > > I'm stuck in below code snippet, looking to have a output as string > without any digits. > Input : "H1e5ll0o" > Output: "Hello" > > I tried with *output := strings.Replace(str

Re: [go-nuts] Remove digits from string

2022-12-29 Thread Mitul sharma
Hello, I'm stuck in below code snippet, looking to have a output as string without any digits. Input : "H1e5ll0o" Output: "Hello" I tried with *output := strings.Replace(str, "1", "", -1)*, but it can replace only single digit at a time I'm looking for suggestions for below code snippet , tri