Navigation: DocScript Reference > DocScript Functions >

String Functions

 

 

 

 

Function

Description

[String.Split](sourcestring, splitstring, removeemptyvalues)

Splits a string into an array. If the third parameter is set to true then blank values will be removed from the array.

 

Parameter(s)

sourcestring - The string to split.

splitstring - The value to split by.

removeemptyvalues - Removes empty values from the array.

[String.Length](sourcestring)

Returns the length of a string.

 

Parameter(s)

sourcestring - The string to determine the length.

[String.Substring](sourcestring, startpos, length)

Returns a sub-string based on the start position and the length.

 

Parameter(s)

sourcestring - The source string that contains the sub-string.

startpos - The start position of where the sub-string starts.

length - The length of the sub-string.

[String.Substring](sourcestring, startpos)

Returns a sub-string based on the start position to the end of the string.

 

Parameter(s)

sourcestring - The source string that contains the sub-string.

startpos - The start position of where the sub-string starts.

[String.Trim](sourcestring)

Trims the string.

 

Parameter(s)

sourcestring - The source string.

[String.LTrim](sourcestring)

Trims the values to the left of the string.

 

Parameter(s)

sourcestring - The source string.

[String.RTrim](sourcestring)

Trims the values to the right of the string.

 

Parameter(s)

sourcestring - The source string.

[String.ToUpper](sourcestring)

Converts string to upper case.

 

Parameter(s)

sourcestring - The source string.

[String.ToLower](sourcestring)

Converts string to lower case.

 

Parameter(s)

sourcestring - The source string.

[String.Item](sourcestring, index)

Returns a character out of a string based on the position.

 

Parameter(s)

sourcestring - The source string.

index - Position in the string.

[String.IndexOf](sourcestring, searchstring, startpos)

Returns a characters out of a string based on a search string at the specified start position.

 

Parameter(s)

sourcestring - The source string.

searchstring - The search string.

startpos - The position in the string to start searching.

[String.IndexOf](sourcestring, searchstring)

Returns a characters out of a string based on a search string from the beginning of the string.

 

Parameter(s)

sourcestring - The source string.

searchstring - The search string.

[String.Contains](sourcestring, searchstring)

Returns true or false if the string contains the search string.

 

Parameter(s)

sourcestring - The source string.

searchstring - The search string.

[String.FindBetween](searchstring, starttoken, endtoken, recurse)
[String.FindBetween](searchstring, starttoken, endtoken)

Extracts one or more strings that are found in between the start and end token. For example, if the search string is *The dog said, "Woof"*, and the starttoken and endtoken are " and ", then FindBetween would return *Woof*. If recurse is true it will search the whole searchstring and return all instances in an array. If recurse is false it will only return the first instance. If no instances are found it will return "" or an empty array.

 

Parameter(s)

searchstring - The search string.

starttoken - The start string token.

endtoken - The end string token. You can also specify EOL to get all the text to the end of the current line.

recurse - This is optional and is used to search for multiple occurrences.

[String.ContainsNumeric](searchstring)

Returns true if the string contains any numeric number (0-9)..

 

Parameter(s)

searchstring - The search string.

[String.ContainsAlpha](searchstring)

Returns true if the string contains any alpha character (a-z;A-Z).

 

Parameter(s)

searchstring - The search string.

[String.ToSSN](ssnwithnodashes)

Takes a 9 digit SSN and reformats it to contain dashes. eg. If input is 123456789, it will return 123-45-6789.

 

Parameter(s)

ssnwithnodashes - The Social Security Number string with no dashes.

[String.Replace](string, oldvalue, newvalue)

Replaces the oldvalue with the newvalue in string.

 

Parameter(s)

string - The source string that contains the string to replace.

oldvalue - The string value to replace.

newvalue - The new string value.

[String.PadLeft](string, totalwidth, paddingchar)

Pads the string from the left with paddingchar for the totalwidth.

 

Parameter(s)

string - The source string to pad.

totalwidth - The length of the padding.

paddingchar - The character to pad the string with.

[String.PadRight](string, totalwidth, paddingchar)

Pads the string from the right with paddingchar for the totalwidth.

 

Parameter(s)

string - The source string to pad.

totalwidth - The length of the padding.

paddingchar - The character to pad the string with.

[String.MakeFilename](string)

Remove illegal filename chars and replaces them with tags.

 

Parameter(s)

string - The filename string.

[String.UnMakeFilename](string)

Add the illegal filename chars and replaces them with the original characters.

 

Parameter(s)

string - The source string to add the illegal characters back in to.

[String.PadDecimal](value)

Will return the decimal string value padded with 2 decimal places. Eg. 10 will return 10.00. 5.5 will return 5.50. 6.78 will return 6.78.

 

Parameter(s)

value - The source value.

[String.PadDecimal](value, numdecimalplaces)

Return the decimal string value padded with numdecimalplaces decimal places.

 

Parameter(s)

value - The source value.

numdecimalplaces - The number of decimal places to pad.

[String.HighestNumber](values1, …., valuesN)

Will return the highest number in the parameters. There must be at least one parameter. A parameter can be an array or a single value.

 

Parameter(s)

value(s) - Comma separated list of values.

[String.LowestNumber](values1, …., valuesN)

Will return the lowest number in the parameters. There must be at least one parameter. A parameter can be an array or a single value.

 

Parameter(s)

value(s) - Comma separated list of values.

[String.SplitPages](pagetext)

Will split an OCR text file, generated by the OCR, into an array of pages.

 

Parameter(s)

pagetext - The OCR text.

[String.Combine](delimiter ,values1,….,valuesN)

Will return the combination of the value parameters, separated by delimiter. Each value parameter can be a single value or an array.

 

E.g.

[String.Combine](‘|’,’10’,’20’,’30’) will return 10|20|30.

 

Parameter(s)

delimiter - The delimiter.

value(s) - Comma separated values to combine.

[String.FindAround](text, findtag)

Will search text for findtag. If findtag is found it will return a block of text, around findtag, 2 lines above and two lines below. It will return the first block it finds.

 

Parameter(s)

text - The source text that includes the find tag text.

findtag - The string tag to locate.

[String.FindAround](text, findtag, linesabovetag, linesbelowtag, charactersleft, charctersright, recurse)

Will search text for findtag. If findtag is found it will return a block of text, around findtag, of the dimensions below:

 

Parameter(s)

text - The source text that includes the find tag text.

findtag - The string tag to locate.

linesabovetag - Specified the lines above.

linesbelowtag - Specified the lines below.

charactersleft - Specified the lines to the left.

charactersright - Specified the lines to the right. If charactersleft is -1, then the block will go to the start of the line. If charactersright is -1, then the block will go to the end of the line.

recurse - This will continue to search the text.

[String.ToTitleCase](sourcestring)

Converts the string to title case. E.g., "war and peace" converts to "War and Peace".

 

Parameter(s)

sourcestring - The source string.

[String.SQuote](sourcestring)

Encloses the string in single quotes.

 

Parameter(s)

sourcestring - The source string.

[String.GetTagContents](xmlstring, tagname, recurse)

Returns an array of value of a tag within an XML formatted search string.

 

Parameter(s)

xmlstring - The XML text.

tagname - The tag name within the XML string.

recurse - Will continue the search once the first instance of the tag is found.

[String.ContainsDups](stringarray)

Returns a true of false depending on whether duplicates strings are found in the string array passed in.

 

Parameter(s)

stringarray - An array of string values.

[String.ReplaceIllegalFileCharacters](filenamestring, replacewithchar)

Replaces illegal filename characters with replacewithchar.

 

Parameter(s)

filenamestring - The string of the filename.

replacewithchar - The character to replace the illegal filename characters with. If this left blank then the illegal characters are removed.

[String.ReplaceSysVars](string)

If you pass in a string the contains system variables in curly brackets. The function will replace the strings with the associated System Variables values.

 

Parameter(s)

string - The string that contains the system variables.

 

 

 

 

Copyright © 2024 Portford Solutions Group, Inc.