Prolog atoms, strings, and characters:

Generalized comparison operators

The following operators can be used for comparisons on a wide range of types
      @< @=< @> @>=

Atom values

Any non-reserved lowercase word is an atom, representing a unique entity, e.g. fred, blue, castle, etc.

If we want an atom name to include spaces, begin with uppercase, include special characters, etc, then we can define the atom in single quotes, e.g. 'Hi there!'.

Character values
Characters can be represented by preceding them with 0', e.g. 0'z for the lowercase z character.

Internally they are stored as their ascii values, e.g. S is 0'x. instantiates variable S with value 120.

If you store characters as single-character atoms, e.g. 'x', then you can use the lower_upper(AtomCharLower, AtomCharUpper) to convert between lower and uppercase.

String values
Depending on the functions in use, strings in (swi)prolog can be represented either as a double-quoted string, e.g. "foo", or as a list of ascii/unicode character values, e.g. [102,111,111]. (It's pretty much a matter of checking documentation to determine which format is used/expected.)

String functions
The built-in list functions work if you have your string as a list of codes (e.g. append(str1,str2,result) while other functions can be applied if you have a double-quoted string. Examples include:
string_length("hello",N) gives N=5,
string_concat("foo","blah",S) gives S="fooblah")
Split string lets you break a large string into a list of smaller ones, where you can specify what character(s) to split at, and any padding characters to be removed from the result. E.g. below we split on commas and remove periods:
split_string("this , is some, text.", ",", ".", L) gives L = ["this","is some","text"]

Various conversion functions include:

Converting to/from double-quoted strings:
atom_string(foo, "foo")
number_string(123, "123")
term_string(foo(x),"foo(x)")

Converting to/from lists of ascii codes:
name(foo,[102,111,111])
name('foo',[102,111,111])
name("foo",[102,111,111])
name(123.4,[49,50,51,46,52])

Converting to/from atoms:
atom_chars(foo,[f,o,o]) (atom vs a list of single-char atoms)
number_atom(123, '123') (number vs atom)
number_chars(123, ['1','2','3'])
string_chars("foo", [f,o,o])

Other atom functions
You can get the number of characters in an atom using atom_length(Atom, Length)
You can concatenate two atoms together to get a third using atom_concat(A1,A2,Result)