Did you know ... Search Documentation:
Pack onepointfour_basics -- prolog/stringy_length.pl
PublicShow source
 stringy_length(+Stringy, ?Length)
Determine the length of Stringy, which may be an atom or a string.

This is not really needed a atom_length/2 and string_length/2 work for both strings and atoms, but it removes the specificity of calling atom_length/2 or string_length/2.

Length may be instantiated to a integer. In that case, the predicate verifies the length of Stringy against Length.

This predicates behaves softly, i.e. preferentially fails on bad input.

 stringy_length(+Stringy, ?Length, @Tuned)
As stringy_length/2, but setting Tuned to hard will make the predicate throw if Length is bound but negative.
 stringy_length_type(+Stringy, ?Length, ?Type)
As stringy_length/2, but additionally takes the Type of the stringy, which is unified with one of atom or string.
 stringy_length_type(+Stringy, ?Length, ?Type, @Tuned)
As stringy_length_type/3, but setting Tuned to hard will make the predicate throw if Type is bound but not one of string, atom (and also if Length is bound but negative).