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

[go-nuts] Re: Unmarshal variable JSON structures

2022-12-29 Thread p...@morth.org
Hi! It's not possible to decode this data without scanning it twice. It's a flawed design where someone has chosen to make that restriction. programming language doesn't matter. The only way to avoid parsing it twice is to decode to a map[string]any and then use that as-is. Which I suppose you