Difference between revisions of "Extensions.StringUtil.IndexOf"

From emotive
Jump to navigation Jump to search
 
Line 9: Line 9:
  
 
== Description ==
 
== Description ==
The '''IndexOf''' term shall return the index within a string of the first occurrence of the specified pattern string. If the pattern is not included in the string, the return value shall be -1.
+
The '''IndexOf''' term will return the index within a string of the first occurrence of the specified pattern string. If the pattern is not included in the string, the return value will be -1.
  
{{TermReturnValue| [[Core.DataTypes.SimpleDataType.Integer|Integer]] | The index within a string of the first occurrence of the specified pattern string. If the pattern is not included in the string, the return value shall be -1.}}
+
{{TermReturnValue| [[Core.DataTypes.SimpleDataType.Integer|Integer]] | The index within a string of the first occurrence of the specified pattern string. If the pattern is not included in the string, the return value will be -1.}}
  
 
== Properties ==
 
== Properties ==
 
{| {{TableHeader}}
 
{| {{TableHeader}}
 
{{TableRowPropertiesHeader}}
 
{{TableRowPropertiesHeader}}
{{TableRowPropertie1| String | [[Core.DataTypes.SimpleDataType.String|String]] | [[Term]] | - | [1] | Represents the input string in which the pattern shall be searched.}}
+
{{TableRowPropertie1| String | [[Core.DataTypes.SimpleDataType.String|String]] | [[Term]] | - | [1] | Represents the input string in which the pattern will be searched.}}
{{TableRowPropertie2| Pattern | [[Core.DataTypes.SimpleDataType.String|String]] | [[Term]] | - | [1] | Represents the sub-string which shall be searched for in the input string.}}
+
{{TableRowPropertie2| Pattern | [[Core.DataTypes.SimpleDataType.String|String]] | [[Term]] | - | [1] | Represents the sub-string which will be searched for in the input string.}}
 
|}
 
|}
  

Latest revision as of 03:18, 13 September 2019

Classification

Name IndexOf
Short Description Position within a string
Class Term
Extension OTX StringUtil extension
Group StringUtil related terms
Exceptions -
Checker Rules -
Standard Compliant Yes

OTL Syntax

IntegerTerm StringUtil.IndexOf(StringTerm string, StringTerm pattern);

Description

The IndexOf term will return the index within a string of the first occurrence of the specified pattern string. If the pattern is not included in the string, the return value will be -1.

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
Integer The index within a string of the first occurrence of the specified pattern string. If the pattern is not included in the string, the return value will be -1.

Properties

Name Data Type Class Default Cardinality Description
String String Term - [1] Represents the input string in which the pattern will be searched.
Pattern String Term - [1] Represents the sub-string which will be searched for in the input string.

OTL Examples

/// Local Declarations

Integer Integer1;

/// Flow

Integer1 = StringUtil.IndexOf("emotive company", "com");

See also

ReplaceSubString
MatchToRegularExpression
StringConcatenate
SubString
LengthOfString
SplitString
ToUpper
ToLower
Encode
Decode