Wafl Home

Primitive Data Types Tutorial

Extraction Functions

Wafl contains the following string extraction functions:

subStr :   (String * Integer * Integer -> String)
strLeft :  (String * Integer -> String)
strRight : (String * Integer -> String)
strLTrim : (String -> String)
strRTrim : (String -> String)
strTrim :  (String -> String)

String extraction functions return a sub string of the specified string argument.

Function subStr(s,p,n) returns sub string of the string s, beginning at position n and n characters long.

Function strLeft(s,n) returns sub string of first n characters of the string s. Function strRight(s,n) returns sub string of last n characters of the string s.

Function strLTrim(s) returns sub string of s not containing leading non-visible characters. Function strRTrim(s) returns sub string of s not containing ending non-visible characters. Function strTrim(s) returns sub string of s not containing both leading and ending non-visible characters.

Source code:

{#
subStr( "abcdefgh", 2, 3 ),
strLeft( "abcdefgh", 3 ),
strRight( "abcdefgh", 3 ),
strLTrim( "   abcd   " ),
strRTrim( "   abcd   " ),
strTrim( "   abcd   " )
#}

Result:

{# "cde", "abc", "fgh", "abcd   ", "   abcd", "abcd" #}

 

Table of Contents

Let's Start

Program Structure

Primitive Data Types

List

Tuple

Record

HTML

Command Line Interpreter

Using Web Servers

Syntax

Examples

Tips

The most of examples evaluates with both command line and Web server Wafl interpreters. If any example is based on specific features of an interpreter, it is explicitly annotated.