diff --git a/CS2JLibrary/NetFramework/System/Console.xml b/CS2JLibrary/NetFramework/System/Console.xml index 26581a7..5030c1f 100644 --- a/CS2JLibrary/NetFramework/System/Console.xml +++ b/CS2JLibrary/NetFramework/System/Console.xml @@ -28,9 +28,9 @@ - CS2JNet.System.ConsoleSupport + CS2JNet.System.StringSupport - System.out.printf(ConsoleSupport.CSFmtStrToJFmtStr(${fmt}), ${arg}) + System.out.printf(StringSupport.CSFmtStrToJFmtStr(${fmt}), ${arg}) System.String @@ -46,9 +46,9 @@ - CS2JNet.System.ConsoleSupport + CS2JNet.System.StringSupport - System.out.printf(ConsoleSupport.CSFmtStrToJFmtStr(${fmt}), ${arg1}, ${arg2}) + System.out.printf(StringSupport.CSFmtStrToJFmtStr(${fmt}), ${arg1}, ${arg2}) System.String @@ -87,9 +87,9 @@ - CS2JNet.System.ConsoleSupport + CS2JNet.System.StringSupport - System.out.printf(ConsoleSupport.CSFmtStrToJFmtStr(${fmt}) + "\\n", ${arg}) + System.out.printf(StringSupport.CSFmtStrToJFmtStr(${fmt}) + "\\n", ${arg}) System.String @@ -105,9 +105,9 @@ - CS2JNet.System.ConsoleSupport + CS2JNet.System.StringSupport - System.out.printf(ConsoleSupport.CSFmtStrToJFmtStr(${fmt}) + "\\n", ${arg1}, ${arg2}) + System.out.printf(StringSupport.CSFmtStrToJFmtStr(${fmt}) + "\\n", ${arg1}, ${arg2}) System.String diff --git a/CS2JLibrary/src/CS2JNet/System/ConsoleSupport.java b/CS2JLibrary/src/CS2JNet/System/ConsoleSupport.java index 88284dd..27715cf 100755 --- a/CS2JLibrary/src/CS2JNet/System/ConsoleSupport.java +++ b/CS2JLibrary/src/CS2JNet/System/ConsoleSupport.java @@ -23,15 +23,5 @@ package CS2JNet.System; public class ConsoleSupport { - // Takes a C# format string and vonverts it to a Java format string - public static String CSFmtStrToJFmtStr(String fmt) - { - return fmt.replaceAll("\\{(\\d)+\\}", "%$1\\$s"); - } - - public static void testMain(String[] args) - { - System.out.printf(CSFmtStrToJFmtStr("DECLARATION: {0}={1}") + "\n", "Kevin", "Great"); - System.out.printf(CSFmtStrToJFmtStr("DECLARATION: {0}={1}"), "Kevin", "Great"); - } + } diff --git a/CS2JLibrary/src/CS2JNet/System/StringSupport.java b/CS2JLibrary/src/CS2JNet/System/StringSupport.java index e9b9259..94bcb6f 100755 --- a/CS2JLibrary/src/CS2JNet/System/StringSupport.java +++ b/CS2JLibrary/src/CS2JNet/System/StringSupport.java @@ -361,7 +361,14 @@ public class StringSupport { } return new String(chars); } - + + // Takes a C# format string and converts it to a Java format string + public static String CSFmtStrToJFmtStr(String fmt) + { + return fmt.replaceAll("\\{(\\d)+\\}", "%$1\\$s"); + } + + public static void Testmain(String[] args) { System.out.println("**" + Trim("") + "**"); @@ -395,8 +402,14 @@ public class StringSupport { System.out.println("Split(\"fred=5\", '=') = [\"" + splitFred[0] + "\", \"" + splitFred[1] + "\"]"); splitFred = Split("=fred",'='); System.out.println("Split(\"=fred\", '=') = [\"" + splitFred[0] + "\", \"" + splitFred[1] + "\"]"); + + System.out.printf(CSFmtStrToJFmtStr("DECLARATION: {0}={1}") + "\n", "Kevin", "Great"); + System.out.printf(CSFmtStrToJFmtStr("DECLARATION: {0}={1}"), "Kevin", "Great"); -} + } + public static void main(String[] args) { + Testmain(args); + } }