User Tools

Site Tools


syntax:functions:remove

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
syntax:functions:remove [2021/07/21 15:32] craigtsyntax:functions:remove [2021/08/15 02:53] (current) – [See also] craigt
Line 1: Line 1:
-====== Remove(text, N_startN_chars) ======+======Remove(text, startlength) ======
 Category:  Text function Category:  Text function
  
 \\  \\ 
 =====Description===== =====Description=====
-This function removes a specified number of characters, from a specified starting point, within a text string.+This function removes a substring of text from //text//, //length// characters longand starting with the //start//<sup>th</sup> character.
  
 \\  \\ 
 =====Arguments===== =====Arguments=====
-^Argument^Description^ +^Argument^Type^Description^ 
-|text|Any text string or value that can implicitly be converted to text.| +|text|Text|Any text value from which the substring of text is removed.| 
-|N_start|The N<sup>th</sup> position of the first character in //text// to start removing from.  The minimum value is 1.| +|start|Number (Integer)|The position of the first character within //text// to be removed.| 
-|N_chars|The number of characters to remove.| +|length|Number (Integer)|The number of characters to remove.| 
-\\  + 
-====Return value type==== +**Return value type:** Text
-Text+
  
 \\  \\ 
 =====Remarks===== =====Remarks=====
-All three arguments must be supplied or a warning applies in each row of the column.+Number values entered for //text// are implicitly converted to text.
  
-If //N_start// is a position past the end of the text, nothing is removed. +Entering a value for //start// that is past the number of characters in //text// returns the full //text// value.
- +
-If //N_chars// exceeds the number of characters that can be removed, all characters from //N_start// to the end of //text// will be removed.+
  
 +Entering a value for //length// that exceeds the number of characters after the //start// position, returns the leading characters in //text// up to the //start// position. 
  
 \\  \\ 
 =====Examples===== =====Examples=====
 +  remove('Betelgeuse', 2, 4) //Returns 'Bgeuse'
  
-  remove('27.03.2015', 6, 5)  =  '27.03' +  remove('Pleiades', 1, 3) //Returns 'iades'
-  remove('27.03.2015', 7, 2)  =  '27.03.15' +
-  remove('Mrs. Smith", 3, 1'Mr. Smith' +
-  remove(1203, 2, 2) = '13' +
-  remove((10*10), 1, 1) = '00'  (removes the first single character from '100'+
-  remove('Alexander', 12, 2) = 'Alexander'  (N_start is past the end of the text - nothing is removed) +
-  remove('Scott', 4, 4) = 'Sco'  (N_chars extends past the end of text; only available characters are removed)+
  
 +  remove(32876, 2, 2) //Returns '376' (Numbers implicitly converted; return value is text)
 +
 +  remove('the', 4, 3) //Returns 'the'  (Starting point past the end of the text; value returned)
 +
 +  remove('Canopus', 4, 6) //Returns 'Can'  (length is past the end of 'Canopus', leading characters returned)
 + 
 \\  \\ 
-===== See also ===== +=====See also===== 
-  * [[syntax:functions:mid]]+  * [[syntax:functions:removechars|RemoveChars(text, chars)]] 
 +  * [[syntax:functions:removeend|RemoveEnd(text, length)]] 
 +  * [[syntax:functions:removestart|RemoveStart(text, length)]] 
 +  * [[syntax:functions:removetext|RemoveText(text, string)]] 
syntax/functions/remove.txt · Last modified: 2021/08/15 02:53 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki