diff --git a/CS2JLibrary/NetTranslations/System/String.xml b/CS2JLibrary/NetTranslations/System/String.xml index 27cc26c..c780d75 100755 --- a/CS2JLibrary/NetTranslations/System/String.xml +++ b/CS2JLibrary/NetTranslations/System/String.xml @@ -14,16 +14,19 @@ - - length - System.Int32 - char System.Char + + length + System.Int32 + - new String(${length}, ${char}) /* FIX ME */ + + RusticiSoftware.System.StringSupport + + StringSupport.mkString(${char}, ${length}) diff --git a/CS2JLibrary/src/RusticiSoftware/System/StringSupport.java b/CS2JLibrary/src/RusticiSoftware/System/StringSupport.java index 4f37286..6148792 100755 --- a/CS2JLibrary/src/RusticiSoftware/System/StringSupport.java +++ b/CS2JLibrary/src/RusticiSoftware/System/StringSupport.java @@ -338,6 +338,15 @@ public class StringSupport { } return index; } + + // in C# new String('x',50) + public static String mkString(char c, int count) { + char[] chars = new char[count]; + for (int i = 0; i < count; i++) { + chars[i] = c; + } + return new String(chars); + } public static void Testmain(String[] args) { @@ -373,5 +382,7 @@ public class StringSupport { splitFred = Split("=fred",'='); System.out.println("Split(\"=fred\", '=') = [\"" + splitFred[0] + "\", \"" + splitFred[1] + "\"]"); -} +} + + }