Copyright ® (1999-2008) EDMGROUP Pty Ltd - EZY Prolog Reference
[This is preliminary specification and subject to change.]
Prolog predicates (more...)
frontchar( STRING Inpstring, STRING START, STRING REST)
Return the first character in a string
The frontchar predicate operates as if it were defined by the equation:
String = (the concatenation of FirstChar and RestString)
The frontchar takes three arguments; the first is a string, the second is a char (the first character of the first string), and the third is the rest of the first string.
The frontchar can be used to split a string up into a series of characters, or to create a string from a series of characters, and to test the characters within a string. If the argument String is bound to a zero-length string, the predicate fails.
Copyright © 1997-2013 EDMGROUP (Australia)