Quote:I've never heard of the Chr() function before, thanks for letting me know about it.
Still, best advice I have here for you is to keep things unique. If you create methods or variables which can be overriden easily (especially enums), that pre-existing one default with the .NET libraries is now invisible when you want to use it.
Here's the Chr() Function for you:
http://msdn.microsoft.com/en-us/library/...s.71).aspx
There's both Chr() and ChrW().
Quote:And when you say there's already a method named Replace, I didn't really overwrite that as I'm still using .replace inside the sub. I just made a sub for that to shorten my code and called it that.
Oh... no

You've actually overriden Replace(), not String.Replace() as the extension method.
This one:
Code:
Dim t As String = "test 123"
t = Replace(t, "test", "testing")
Look:
Code:
// Code size 48 (0x30)
.maxstack 6
.locals init ([0] string str1,
[1] string str2)
IL_0000: nop
IL_0001: ldstr "test2"
IL_0006: ldstr "test"
IL_000b: ldstr "testing"
IL_0010: ldc.i4.1
IL_0011: ldc.i4.m1
IL_0012: ldc.i4.0
IL_0013: call string [Microsoft.VisualBasic]Microsoft.VisualBasic.Strings::Replace(string,
string,
string,
int32,
int32,
valuetype [Microsoft.VisualBasic]Microsoft.VisualBasic.CompareMethod)
IL_0018: stloc.0
IL_0019: ldstr "test1"
IL_001e: ldstr "test"
IL_0023: ldstr "testing"
IL_0028: callvirt instance string [mscorlib]System.String::Replace(string,
string)
IL_002d: stloc.1
IL_002e: nop
IL_002f: ret
There's one from the VisualBasic methods, and the System.String namespace for VB in terms of Replace functions. I think you're also just unaware that the VisualBasic Replace() function existed
My homework for you:
-Research Chr()
-Research Replace()
Here's the Replace functions, both the one you are thinking i'm talking about, and the one I am talking about:
http://msdn.microsoft.com/en-us/library/...s.80).aspx
http://msdn.microsoft.com/en-us/library/...place.aspx
Quote:Yet again, you've found a easier and shorter way to create what I've done. Thanks for the tips and maybe one day I'll be simplifying your code for you
Just keep at it, i've been using .NET for quite a while now. And I practically use it everyday still.