extracts the first n characters from a string
frontstr("Hello World",6,FrontStr,RestString)
frontstr(String,Count,FrontStr,RestString) (i,i,x,x)
string(String) (i) string to be separated
integer(Count) (i) the FrontString will consist of Count characters
string(FrontStr) (x) first Count characters of String
string(RestString) (x) String without its first Count characters
This establishes a relation between String, Count, FronStr, and RestString, thus that String = FrontStr+RestString and str_len(FronStr,Count) is true. The String and Count arguments must be initalized.
frontstr("Hello World",6,F,R), concat("Happy ",R,Str), write(Str),nl.
A runtime error occurs if the arguments belong to the wrong domain. Fails if the relation cannot be established.
prolog-process, client-server, object
frontchar , str_char , fronttoken , prologtoken , concat , str_len