Smallest code to return sum of all characters in an array of strings

Haskell, 21 19 bytes

succ.length.unwords

Edit: Removed two bytes thanks to ais523!


GolfScript [4 bytes]

n*,)

There are no functions in GolfScript, so you should use a standard input instead:

["abc" "bdef" "cee" "deee"]
n*,)

>>> 18

DEMO: http://golfscript.apphb.com/?c=WyJhYmMiICJiZGVmIiAiY2VlIiAiZGVlZSJdCgpuKiwp


Mathematica 31 29 bytes

-2 bytes thanks to numbermaniac

StringLength[""<>#]+Length@#&

Example

StringLength[""<>#]+Length@#&@{ "abc", "bdef", "cee", "deee" }

18

Tags:

Code Golf