The String Plugin

The String Plugin provides atoms for string operations and manipulations.

&concat takes two strings as input and returns their concatenation:

&concat[A,B](X)
Input:
A
string
B
string
Output:
X
Concatenation of A and B

Example:

fullstring(Full) :- &concat[P,F](Full), stringpair(P,F).

&strstr evaluates to true if the second input argument is a (case-insensitive) substring of the first:

&strstr[A,B]
Input:
A
string
B
string

Example:

austrian_phone(P) :- &strstr[P,"+43"], phonenumber(P).

&split splits a string by a specified delimiter:

&split[A,D,N](X)
Input:
A
string to split
D
delimiter
N
index of item to return (starting from 0)
Output:
X
Nth substring of A, split by D

Example:

month(M) :- &split["2006-04-26","-",1](M).

&sha1sum calculates the SHA1 sum of a string:

&sha1sum[A](X)
Input:
A
string
Output:
X
SHA1 sum of A

Example:

owner(ID) :- &sha1sum[X](ID), mailbox(X).

$Id$

 

General
dlvhex source code @ github.com
Description-Of-A-Project

Popular Plugins
Action Plugin
DecisionDiagrams Plugin
Description Logics Plugin
Description Logics Lite Plugin
MELD: Belief Merging Plugin
Nested HEX Plugin
MCSIE Plugin
String Plugin
dlvhex-semweb Project

Documentation
User Guide
README
doxygen
Writing Plugins in C++
Writing Plugins in Python