GameCTO / luainterface

Automatically exported from code.google.com/p/luainterface
0 stars 0 forks source link

DoString : problem passing a string containing '\' (backslash) #63

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I don't know if I will get an answer for this but I hope so !

I have the following C# method in a class :

public static string FindFile(string path)
{
  //...
}

I call this function thru a lua statement using the DoString fct BUT my string 
parameter can contain a '\' backslash, I try :

_Lua.DoString("b=MyFile.FindFile('DIR1\\myfile.txt')");

The C# FindFile function is called correctly but the path parameter contains 
the following :

DIR1myfile.txt

I have tried to double the slash like this :

_Lua.DoString("b=MyFile.FindFile('DIR1\\\\myfile.txt')");

but in this way, the path contains the following :

DIR1\\myfile.txt

Any idea how I can solve/bypass this ?

Thanks in advance,
sincerly,
Domi.

Original issue reported on code.google.com by gosymb...@gmail.com on 31 Oct 2013 at 10:04