PDA

View Full Version : Input Remove Text Help


GoOgLe
03-24-2007, 04:07 PM
is it possible to remove just this code from input object when whole code is selected ???? like the one in the forum Remove Link

GoOgLe
03-25-2007, 04:49 AM
can someone help me please ???

yosik
03-25-2007, 07:14 AM
You could use a combination of TrimLeft and TrimRight on a string, as follows:

yourText = Input.GetText("input1");
yourText = String.TrimLeft (yourText, ");
yourText = String.TrimRight (yourText, " ("")");

Good luck
Yossi

RizlaUK
03-25-2007, 08:43 AM
Here, try this (change the input names)

strText = Input.GetText(MainInput);
cPos=GetCaretPos(MainInput)
cRow=GetCaretRow(MainInput)
cpRow=GetCaretPosInRow(MainInput)
selString = Input.GetSelection(MainInput);

if selString ~= nil then
sel = selString.End-selString.Start
Selection = String.Mid(strText, selString.Start, sel+1);
Selection2 = String.Mid(Selection, String.Find(Selection, "]") + 1, -1);
Selection3 = String.Replace(Selection2, "[/URL]", "", false);
BeforSelection = String.Mid(strText, 0, selString.Start);
AfterSelection = String.Mid(strText, selString.End+1, -1);
Input.SetText(MainInput, BeforSelection..Selection3..AfterSelection);
fsel = String.Length(Selection3);
Input.SetSelection(MainInput, selString.Start, selString.Start+fsel);
Input.ScrollToLine("inp_main", cRow);
end

GoOgLe
03-25-2007, 03:53 PM
thanks Rizlauk

perfect working