Extensions.StringUtil.ReplaceSubString

From emotive
Revision as of 08:20, 3 October 2018 by Hb (talk | contribs)
Jump to navigation Jump to search

Classification

Name ReplaceSubString
Short Description Replacing strings
Class Term
Extension OTX StringUtil extension
Group StringUtil related terms
Exceptions OutOfBoundsException
Checker Rules -
Standard Compliant Yes

OTL Syntax

StringTerm = ReplaceSubString(StringTerm, StringTerm, NumericTerm);

Description

ReplaceSubString term shall yield a new string value which is constructed out of an original string whose contents are overwritten by a replacement string, starting at a given position. If the replacement exceeds the right end of the original string, the length of the resulting string is expanded accordingly.

Return Value

The Term returns the value, see table below.

Icons Note.png In OTX, Terms are categorized according to its return data type!
Data Type Description
String The replacement string

Properties

Name Data Type Class Default Cardinality Description
String String Term - [1] Represents the original String.
Replacement String Term - [1] Represents the String value that shall replace the part starting at index of the original String.
Index Numeric Term - [1] The Integer value represents the position in the original String where the replacement starts (the first character in the original String has the index zero). Float values shall be truncated.

OTL Examples

String String1;

/// Flow

String1 = StringUtil.ReplaceSubString("emotive company", "COMPANY", 8);

See also

MatchToRegularExpression
StringConcatenate
SubString
LengthOfString
IndexOf
SplitString
ToUpper
ToLower
Encode
Decode