ID:1832145
 
proc/_copytext(string,start,finish,skip_start=1)
string=copytext(string,(istext(start)?findtext(string,start)+(skip_start==1?length(start):0):start))
string=(!isnull(finish)?copytext(string,1,istext(finish)?findtext(string,finish):finish):string)
return string


Arguments: The STRING argument will be the string we shall manipulate. The START argument will be the position to start at, either a number or text value. The FINISH argument will be the position to end at, either a number or text value. The SKIP_START argument is a numerical value to determine if you should skip the start, if it's defined as a string or not.

Purpose of use: People who use findtext() alot in copytext(), just put in the string itself!

It works with both numerical positions and strings!

If you wish to copy the start position of a string just set the SKIP_START argument to 0!

HOW TO USE:
var/string="Hello, my name is billy!"
world<<_copytext(string,"my","billy") //returns " name is "
world<<_copytext(string,findtext(string,"my"),findtext(string,"billy")) //returns " name is "
world<<_copytext(string,"my","billy",0) //returns "my name is "
You don't need the ==1 check on skip_start. Better to let it simply test for true/false.