|
Copyright ® (1999-2008) EDMGROUP Pty Ltd - EZY Prolog Reference |
[This is preliminary specification and subject to change.]
Group
Type
determ
Syntax
frontchar( STRING Inpstring, STRING START, STRING REST)
Flow patterns
(i,o,o),(i,i,o),(i,o,i),(i,i,i),(o,i,i)
Description:
Return the first character in a string
Remarks
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.
Sample:
No sample