Difference between revisions of "MidStr"

From MultiCharts
Jump to navigation Jump to search
(Created page with "Returns a part, starting from a specified position and of a specified length, of a specified string expression. ==== Usage ==== <syntaxhighlight>MidStr("String",Pos,Num)</s...")
 
m (Reverted edits by 176.8.90.7 (talk) to last revision by JoshM)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
Returns a part, starting from a specified position and of a specified length, of a specified string expression.  
 
Returns a part, starting from a specified position and of a specified length, of a specified string expression.  
 
   
 
   
==== Usage ====
+
== Usage ==
<syntaxhighlight>MidStr("String",Pos,Num)</syntaxhighlight>  
+
<syntaxhighlight>MidStr("String", Pos, Num)</syntaxhighlight>  
  
Where: [[String]] - a string expression the specified part is to be taken from  
+
Where:  
 +
 
 +
:'''String''' - a string expression where the specified part is to be taken from.
 
              
 
              
[[Pos]] - a numerical expression specifying the position, from the left side of the string, of the starting character of the part  
+
:'''Pos''' - a numerical expression specifying the position, from the left side of the string, of the starting character of the part to be taken.
 
              
 
              
[[Num]] - a numerical expression specifying the length, in characters, of the part  
+
:'''Num''' - a numerical expression specifying the length, in characters, of the part to be taken.
 
   
 
   
==== Example ====
+
== Example ==
<syntaxhighlight>MidStr("Largest winning trade",1,7); will return a string expression "Largest"</syntaxhighlight>
+
<syntaxhighlight>MidStr("Largest winning trade", 1, 7);</syntaxhighlight>
 +
Will return a string expression "Largest".
 
   
 
   
 +
== Notes ==
 +
* See [[LeftStr]] to return the leftmost part of a string,
 +
* See [[RightStr]] to return the rightmost part of a string,
 +
* See [[InStr]] to get the starting location of a expression in a string.
 
[[Category:Text Manipulation]]
 
[[Category:Text Manipulation]]

Latest revision as of 12:38, 13 February 2012

Returns a part, starting from a specified position and of a specified length, of a specified string expression.

Usage

MidStr("String", Pos, Num)

Where:

String - a string expression where the specified part is to be taken from.
Pos - a numerical expression specifying the position, from the left side of the string, of the starting character of the part to be taken.
Num - a numerical expression specifying the length, in characters, of the part to be taken.

Example

MidStr("Largest winning trade", 1, 7);

Will return a string expression "Largest".

Notes

  • See LeftStr to return the leftmost part of a string,
  • See RightStr to return the rightmost part of a string,
  • See InStr to get the starting location of a expression in a string.