Difference between revisions of "Extensions.StringUtil.ReplaceSubString"
Jump to navigation
Jump to search
Line 3: | Line 3: | ||
{{ClassificationActivity | ReplaceSubString | Replacing strings | [[Term]] | [[StringUtil|OTX StringUtil extension]] | [[StringUtil related terms]] | [[OutOfBoundsException]] | - }} | {{ClassificationActivity | ReplaceSubString | Replacing strings | [[Term]] | [[StringUtil|OTX StringUtil extension]] | [[StringUtil related terms]] | [[OutOfBoundsException]] | - }} | ||
− | == | + | == OTL Syntax == |
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | + | StringTerm = ReplaceSubString(StringTerm, StringTerm, IntegerTerm); | |
</syntaxhighlight> | </syntaxhighlight> | ||
Line 21: | Line 21: | ||
|} | |} | ||
− | == Examples == | + | == OTL Examples == |
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | String | + | String String1; |
+ | |||
+ | String1 = ReplaceSubString("emotive company", "COMPANY", 8); | ||
//Returns result = "Emotive" | //Returns result = "Emotive" | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 10:30, 10 February 2015
Contents
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, IntegerTerm);
Description
ReplaceSubString term replaced the strings with replacement string, starting at the specified position (index) within a strings and returns the result.
Return Value
The Term returns the value, see table below.
![]()
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] | The original string |
Replacement | String | Term | - | [1] | The string that replaces a portion of the original string starting at the specified position |
Index | Iteger | Term | - | [1] | The zero-based position of the original string, from which starts the replacement |
OTL Examples
String String1;
String1 = ReplaceSubString("emotive company", "COMPANY", 8);
//Returns result = "Emotive"
See also
MatchToRegularExpression
StringConcatenate
SubString
LengthOfString
IndexOf
SplitString
ToUpper
ToLower
Encode
Decode