PDA

View Full Version : string


WebCyb
01-23-2008, 11:48 AM
Hi,

it's possible make this

for example
in input 1 I have this:
C:\Documents and Settings\Encript.mpg

and in input 2 I have this:
C:\Encript files

In this case I need to insert Encript.mpg after C:\Encript files and add "\"

on final it's show: C:\Encript files\Encript.mpg in input 3.

that is to do with all extensions of files, I have been ace walking laps with it and see no solution to make this. If anyone could help, I appreciate that.


regards,
WebCyb

holtgrewe
01-23-2008, 12:33 PM
Here's something that might work for you, or at least give you some ideas.

inp1 = Input.GetText("Input1");
inp2 = Input.GetText("Input2");

inpx = String.ReverseFind(inp1, "\\", false); --find the cutoff pos in inp1
lendiff = String.Length(inp1) - inpx + 1; -- find the length of the cutoff

inp3 = ""..inp2 ..String.Mid(inp1,inpx,lendiff); -- build the new string
Input.SetText("Input3", ""..inp3);

hth

WebCyb
01-23-2008, 03:06 PM
Many thanks holtgrewe

works fine ;)