I do it like this :
the char "@" does not occur in your string. Othewise use in FS another char which surely never can occur in your string.
##################### count the chars in string
x="123 44 55 ffffccc xxx"
chars=`echo $x | awk ' BEGIN { FS="@"}
{
x=length($1)
y=0
while ( y != x)
{
y=y+1
if (substr($1, y, 1 ) != " " )
{
chars=chars+1
}
}
} END {
print chars
}'`
echo "numbers of chars in variabe x "$chars