07-13-2005, 03:23 PM
Create new member function str.ReplaceLineN and paste this code:
function# $replacement lineindex
;Replaces specified line.
;Returns index of first character of n-th line, or -1 if n is too big.
;replacement - replacement string.
;lineindex - zero-based line index.
;EXAMPLE
;str s="zero[]one[]two"
;s.ReplaceLineN("ONE" 1)
;out s
int i=findl(this lineindex)
if(i>=0)
,int j=findcs(this "[]" i)
,this.replace(replacement i iif(j>=0 j-i -1))
ret i