Delete: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Heeheehee
m Renamed start and end since it might confuse readers (they happen to be other ASH functions dealing with buffers)
imported>Bale
mNo edit summary
Line 5: Line 5:
FunctionPage|
FunctionPage|
name={{#var:name}}|
name={{#var:name}}|
function_category=String Handling Routines|


function1={{Function|
function1={{Function|
Line 40: Line 39:
see_also={{SeeAlso|insert}}|
see_also={{SeeAlso|insert}}|
}}
}}
[[Category:String Handling Routines]]

Revision as of 05:13, 22 May 2010

Function Syntax

buffer delete(buffer original ,int strStart ,int strEnd )

  • original is the buffer to modify
  • strStart marks where to start deleting
  • strEnd marks where to end deleting

Returns the buffer original with the substring from strStart to strEnd removed.

Code Sample

Removes the border that KoL uses to frame some tables.

buffer results;
results.append(visit_url());

string del = " style=\"padding: 5px; border: 1px solid blue;\"";
int st = results.index_of(del);
if ( st > -1 ) results.delete(st, st+length(del));
else print("string '"+del+ "' not found"); 
results.write();

See Also

insert()