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

javascript - Can Piwik report referrer in real time? -

asp.net - Google Drive Access: At least one client secrets (Installed or Web) should be set -

excel vba add hyperlink to shape in group -