function

Count_chars . string . sncode

VERSIONlatest Return information about characters used in a string.

COUNT_CHARS(1e)

NAME

Count_chars - Returns information about characters used in a string.

SYNOPSIS

Count_chars(str,asstr)

PARAMETERS

str
The input string. To use this function, one has to define an input that will be analyzed. asstr If you put "true" as asstr, it returns the value as a string instead of a context. If you put nothing, it returns the frequency of every byte as value. This is optional.
asstr
If you put "true" as asstr, it returns the value as a string instead of as a context. If you put nothing, it returns the frequency of every byte as value. This is optional.

RETURN

Array
It returns an array with the byte-value as key and the frequency of every byte as value. This means that it will show you how many times a character is written in the input. It will also return a string containing all unique characters, depending on what you put as asstr.

EXAMPLES

Note: In the followings examples, the _ between the { should be removed to make it work.

in:  res={_{count_chars("helloòó worldòó")}}.
out: res={" ":1,"r":1,"d":1,"e":1,"ò":2,"ó":2,"w":1,"h":1,"l":3,"o":2}.

in:  res={_{count_chars("helloòó worldòó",true)}}.
out: res=heloòó wrd.

AUTHOR

Written by Pusnei Sergey and Caroline Laplante, <sergey@sednove.com>