nim - Converting a seq[char] to string -


i'm in situation have seq[char], so:

import sequtils var s: seq[char] = toseq("abc".items) 

what's best way convert s string (i.e. "abc")? stringifying $ seems give "@[a, b, c]", not want.

the efficient way write procedure of own.

import sequtils var s = toseq("abc".items)  proc tostring(str: seq[char]): string =   result = newstringofcap(len(str))   ch in str:     add(result, ch)  echo tostring(s) 

Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -