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

symfony - InvalidConfigurationException in SecurityExtension.php line 429: No authentication listener registered for firewall "secured_area" -

angular ui router - 10 digest iterations reached in angularjs when using $state.go -

javascript - Handling constructor related functions while testing with mocha and sinon -