Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter FiveGeneral Functions (continued) 

5.4 Basic String Functions

5.4.1 Overview

The section covers basic string functions that perform simple string manipulation, searching, trimming and conversion.

5.4.2 Functions

Analysis:

GetListItemType — Scans a word and returns its characteristics as a list item.

GetNumericType — Scans a number (word) and returns its characteristics.

GetWordType — Gets the type of word and word characteristics of a string.

Case Change:

ChangeCase — Changes the case of a string including processing HTML.

CharacterToLowerCase — Converts a character to lower case (ANSI only).

CharacterToUpperCase — Converts a character to upper case (ANSI only).

MakeLowerCase — Makes a string lower case as ANSI or Unicode.

MakeUpperCase — Makes a string upper case as ANSI or Unicode.

Concatenation:

AppendWithDelimiter — Appends string data to string target with optional delimiter string (default delimiter is “, ”).

General:

GetStringLength — Returns the size of a string in characters.

Managing New Lines:

ConvertAddNewlines — Copies string and adds newline (0x0A) characters to return (0x0D) characters.

ConvertDeleteNewlines — Copies string while deleting newline (0x0A) characters.

Matching:

CompareStrings — Compares string a to string b and returns 0 if equal, -1 if a < b and 1 if a > b.

CompareStringsNoCase — Compares string a to string b without regard to text case and returns 0 if equal, -1 if a < b and 1 if a > b.

FindInString — Finds a string within a string with optional position and case sensitivity.

InString — Tests for a string as part of a target string with or without case sensitivity.

ScanString — Scans a string as a list delimited by spaces, commas or line endings.

ReplaceInString — Replaces matching strings inside another string with or without case sensitivity.

ReplaceInStringRegex — Replaces matching strings inside another string using regular expression rules.

See also BinaryCompare, BinaryCompareNoCase, FindInList and FindInTable.

Parameter Processing:

GetParameter — Gets a specific parameter name from a property/parameter value list.

GetParameterName — Gets the name from a property/parameter value pair.

GetParameterValue — Gets the value from a property/parameter value pair.

GetParameterEqualName — Gets the name from a parameter '=' value pair.

GetParameterEqualValue — Gets the value from a parameter '=' value pair.

GetStringFromQuotes — Returns the contents of a quoted string such as a quoted filename.

QuotedStringToString — Extracts string from a quoted capsule with basic encoding.

StringToQuotedString — Places source string into a quoted capsule with basic encoding.

Spacing:

ConvertNoSpaces — Converts a string by removing all space characters (0x20).

ConvertToSingleSpaces — Converts multiple spaces to single spaces, trims front and back.

ConvertWordSpaces — Converts all word spaces to single spaces.

GetTrimmedStringLength — Gets the length or size of a string as if it were trimmed for spaces.

SkipBackWordSpaces — Skips back from a specified index to the first non-word space character.

SkipToLineEnding — Skips forward to the next line ending character (0x0D/0x0A).

SkipToNonText — Skips forward to a character that is not alpha-numeric.

SkipToWordSpace — Skips forward until a word space is found.

SkipWordSpaces — Skips forward until not on a word space.

TrimNonBreakingSpaces — Trims non-breaking spaces (as raw characters).

TrimPadding — Trims the padding on both left and right sides of string.

TrimPaddingEntities — Trims the padding on both left and right sides of string including space entities.

TrimString — Trims the trailing spaces from the right side (end) of a string.

SGML, XML and PCDATA:

ANSITextToXML — Converts an ANSI string to XML CDATA.

CharacterEntityToValue — Converts an XML or HTML character entity to a character value.

GetQNameParts — Cracks an XML QName into a namespace and element/attribute name.

GetTagAttributes — Gets the attributes of an SGML tag.

GetTagElement — Gets the element portion of an SGML tag with optional namespace.

GetTagTextContent — Gets the text/PCDATA content up to the next SGML tag.

ValueToCharacterEntity — Converts a character to a character entity value.

XMLTextToANSI — Converts XML text to an ANSI string.

XMLTextToUTF — Converts XML text to an UTF-8 string.

Special Conversion:

ConformAddressString — Conforms the case and style of an address line.

ConvertFromEscapeCharacters — Copies from escaped characters (with backslash such as \r or \n).

ConvertFromUnderbars — Converts underbars in a string to spaces.

ConvertFromUnderlines — Removes the static control underline characters.

ConvertNoCodes — Converts a string and changes all control codes (including newlines, returns, tabs) to period (‘.’) characters.

ConvertNoPunctuation — Converts a string by removing any punctuation.

ConvertSoftBreaksToSpaces — Converts soft break characters (0x09, 0x0D, 0x0A) to spaces.

ConvertToEscapeCharacters — Copies to escaped characters (with backslash such as ‘/r’ ‘/n’)

ConvertToUnderbars — Copies with spaces changed to underbars.

ConvertToUnderlines — Copies to static control underline characters using escaped ‘&’.

String Segments:

DeleteStringSegment — Deletes the segment from the zero-based position for a specified size.

GetStringSegment — Extracts a section or segment of a string.

InsertStringSegment — Inserts a string segment into another string at the zero-based position.

LayerStringSegment — Layers one string on top of another string at a specified position.

ReplaceStringSegment — Replaces a specified segment within a string with another string.

Miscellaneous:

GetNthWord — Returns a word at a specific position within a string.

GetWordCount — Returns the number of parsed items within a string.

OrderProperName — Parses name of a person and orders the components as directed.

PadString — Pads a string to a specified size with optional fill string and direction.

ReverseString — Reverses the character position content of a string.

SplitProperName — Splits a person's name into first and last names.

StripOrdinalSuffix — Strips the ordinal suffix from a number (i.e., '1st' to '1').

TrailStringAfter — Trails off a string with an ellipse (‘...’ characters) if exceeds specified size.

TrailStringAfterAlways — Trails off a string with an ellipse (‘...’ characters) at specified size or always.

TrailStringBefore — Truncates a string and adds ellipse (‘...’ characters) at the start of the string if the length exceeds the specified size.

WordsToArray — Parses a string and returns an array of words.