Strdel

From kwiki

Jump to: navigation, search
This article is written by Konrad, thus using rather nonstandard English:)

strdel (DNM Script function)

Contents

full declaration

String strdel (string str,int nFrom,[int nTo=nFrom])

return value

String

description

Removes characters from nFrom to nTo (which by default = nFrom)and returns the result.

Example

var $s="abcde";
var $sTest=strdel($s,0);//remove character at position 0
MessageBox($sTest);//result: "bcde"
$sTest=strdel($s,0,1);//remove characters from position 0 to 1
MessageBox($sTest);//result: "cde"
$sTest=strdel($s,1,1);//remove characters from 1 to 1 (in other words remove character at position 1)
MessageBox($sTest);//result: "acde"
$sTest=strdel($s,2,4);//remove characters from 2 to 4 (including positions 2 and 4)
MessageBox($sTest);//result: "ab"
Personal tools
konradp.com