Added more string lua functions
This commit is contained in:
parent
cb600e5bf7
commit
08504fc25a
|
@ -117,6 +117,7 @@
|
||||||
<Compile Include="lua\EmuLuaLibrary.Movie.cs" />
|
<Compile Include="lua\EmuLuaLibrary.Movie.cs" />
|
||||||
<Compile Include="lua\EmuLuaLibrary.NES.cs" />
|
<Compile Include="lua\EmuLuaLibrary.NES.cs" />
|
||||||
<Compile Include="lua\EmuLuaLibrary.SNES.cs" />
|
<Compile Include="lua\EmuLuaLibrary.SNES.cs" />
|
||||||
|
<Compile Include="lua\EmuLuaLibrary.String.cs" />
|
||||||
<Compile Include="lua\LuaDocumentation.cs" />
|
<Compile Include="lua\LuaDocumentation.cs" />
|
||||||
<Compile Include="lua\LuaFile.cs" />
|
<Compile Include="lua\LuaFile.cs" />
|
||||||
<Compile Include="lua\LuaFileList.cs" />
|
<Compile Include="lua\LuaFileList.cs" />
|
||||||
|
|
|
@ -19,7 +19,6 @@ namespace BizHawk.Client.Common
|
||||||
"ror",
|
"ror",
|
||||||
"rshift",
|
"rshift",
|
||||||
"check",
|
"check",
|
||||||
"signed",
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,14 @@ namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
"hex",
|
"hex",
|
||||||
"binary",
|
"binary",
|
||||||
|
"trim",
|
||||||
|
"replace",
|
||||||
|
"toupper",
|
||||||
|
"tolower",
|
||||||
|
"startswith",
|
||||||
|
"substring",
|
||||||
|
"contains",
|
||||||
|
"endswith",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,6 +37,50 @@ namespace BizHawk.Client.Common
|
||||||
return binary;
|
return binary;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string string_trim(object str)
|
||||||
|
{
|
||||||
|
return Convert.ToString(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string string_replace(object str, object str2, object replace)
|
||||||
|
{
|
||||||
|
return Convert.ToString(str).Replace(Convert.ToString(str2), Convert.ToString(replace));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string string_toupper(object str)
|
||||||
|
{
|
||||||
|
return Convert.ToString(str).ToUpper();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string string_tolower(object str)
|
||||||
|
{
|
||||||
|
return Convert.ToString(str).ToLower();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string string_substring(object str, object position, object length)
|
||||||
|
{
|
||||||
|
return Convert.ToString(str).Substring((int) position,(int) length);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string string_remove(object str, object position, object count)
|
||||||
|
{
|
||||||
|
return Convert.ToString(str).Remove((int) position,(int) (count));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool string_contains(object str, object str2)
|
||||||
|
{
|
||||||
|
return Convert.ToString(str).Contains(Convert.ToString(str2));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool string_startswith(object str, object str2)
|
||||||
|
{
|
||||||
|
return Convert.ToString(str).StartsWith(Convert.ToString(str2));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool string_endswith(object str, object str2)
|
||||||
|
{
|
||||||
|
return Convert.ToString(str).EndsWith(Convert.ToString(str2));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
new NESLuaLibrary().LuaRegister(lua, Docs);
|
new NESLuaLibrary().LuaRegister(lua, Docs);
|
||||||
new SavestateLuaLibrary().LuaRegister(lua, Docs);
|
new SavestateLuaLibrary().LuaRegister(lua, Docs);
|
||||||
new SNESLuaLibrary().LuaRegister(lua, Docs);
|
new SNESLuaLibrary().LuaRegister(lua, Docs);
|
||||||
//new StringLuaLibrary().LuaRegister(lua, Docs);
|
new StringLuaLibrary().LuaRegister(lua, Docs);
|
||||||
|
|
||||||
Docs.Sort();
|
Docs.Sort();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue