|
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using System.Diagnostics; |
| 4 | +using System.Linq; |
| 5 | +using System.Text; |
| 6 | +using System.Threading.Tasks; |
| 7 | +using MySQLCLRFunctions; |
| 8 | + |
| 9 | +namespace TestMySQLCLRFunctions |
| 10 | +{ |
| 11 | + class Program |
| 12 | + { |
| 13 | + static void Main(string[] args) |
| 14 | + { |
| 15 | + string output; string input; string marker; int markerno; int howmanyback; |
| 16 | + // var i = MySQLCLRFunctions.StringExtract.LeftOf("High.There", "."); |
| 17 | + // Debug.Print(i); |
| 18 | + // i = MySQLCLRFunctions.StringExtract.LeftOfNth("High.There", ".", 2); |
| 19 | + // Debug.Print(i); |
| 20 | + input = "EDWPROD.UserData.x.y"; |
| 21 | + marker = "."; |
| 22 | + markerno = 2; |
| 23 | + howmanyback = 1; |
| 24 | + output = MySQLCLRFunctions.StringExtract.LeftOfNth(input, marker, markerno); |
| 25 | + Debug.Print($"MySQLCLRFunctions.StringExtract.LeftOfNth(\"{input}\", \"{marker}\", {markerno});=> {output}"); |
| 26 | + markerno = 3; |
| 27 | + output = MySQLCLRFunctions.StringExtract.LeftOfNth(input, marker, markerno); |
| 28 | + Debug.Print($"MySQLCLRFunctions.StringExtract.LeftOfNth(\"{input}\", \"{marker}\", {markerno});=> {output}"); |
| 29 | + markerno = 5; |
| 30 | + output = MySQLCLRFunctions.StringExtract.LeftOfNth(input, marker, markerno); |
| 31 | + Debug.Print($"MySQLCLRFunctions.StringExtract.LeftOfNth(\"{input}\", \"{marker}\", {markerno});=> {output}"); |
| 32 | + |
| 33 | + markerno = 1; |
| 34 | + output = MySQLCLRFunctions.StringExtract.LeftMOfNth(input, marker, markerno, howmanyback); |
| 35 | + Debug.Print($"MySQLCLRFunctions.StringExtract.LeftMOfNth(\"{input}\", \"{marker}\", {markerno}, {howmanyback});=> {output}"); |
| 36 | + markerno = 2; howmanyback = 2; |
| 37 | + output = MySQLCLRFunctions.StringExtract.LeftMOfNth(input, marker, markerno, howmanyback); |
| 38 | + Debug.Print($"MySQLCLRFunctions.StringExtract.LeftMOfNth(\"{input}\", \"{marker}\", {markerno}, {howmanyback});=> {output}"); |
| 39 | + markerno = 1; howmanyback = 2; |
| 40 | + output = MySQLCLRFunctions.StringExtract.LeftMOfNth(input, marker, markerno, howmanyback); |
| 41 | + Debug.Print($"MySQLCLRFunctions.StringExtract.LeftMOfNth(\"{input}\", \"{marker}\", {markerno}, {howmanyback});=> {output}"); |
| 42 | + markerno = 2; howmanyback = 4; |
| 43 | + output = MySQLCLRFunctions.StringExtract.LeftMOfNth(input, marker, markerno, howmanyback); |
| 44 | + Debug.Print($"MySQLCLRFunctions.StringExtract.LeftMOfNth(\"{input}\", \"{marker}\", {markerno}, {howmanyback});=> {output}"); |
| 45 | + input = "[xxx]]y]"; |
| 46 | + output = MySQLCLRFunctions.StringTransform.RemoveSQLServerNameDelimiters($"{input}"); |
| 47 | + Debug.Print($"MySQLCLRFunctions.StringTransform.RemoveSQLServerNameDelimiters(\"{input}\");=> {output}"); |
| 48 | + } |
| 49 | + } |
| 50 | +} |
0 commit comments