BAP Online Manuals : Library Reference : Library by Name : frontchar
Previous: free_server
Next: frontstr

6.2.61. frontchar

extracts the first character from a string

SYNOPSIS

frontchar("Hello",Char,RestString)

SYNTAX

 frontchar(String,Char,RestString) (i,x,x) (o,i,i)

ARGUMENTS

string(String) (x) string to be separated
char(Char) (x) first character of string
string(RestString) (x) string without its first character

DESCRIPTION

This establishes a relation between String, Char, and RestString, thus that String = Char+RestString. The arguments must be sufficiently initalized, so that all three arguments can be determined.

EXAMPLE

frontchar("Hello",C,R),
frontchar(Str,C,R),
write(Str),nl.

ERRORS

A runtime error occurs if the arguments belong to the wrong domain. Fails in case of insufficiently initialised arguments or if the relation cannot be established.

LAYERS

prolog-process, client-server, object

RELATED PREDICATES

frontstr , str_char , fronttoken , prologtoken , concat


BAP Online Manuals : Library Reference : Library by Name : frontchar
Previous: free_server
Next: frontstr