There is a built in .NET method to capitalize the first letter of each word in a string:
newStr = Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(str)
This is easier than writing the function to do it.
I found this at:
http://www.vbforums.com/showthread.php?557905-Uppercase-first-letter-in-each-word-of-a-string.
This blog is a depository for things I have found regarding VB.NET and C#.NET development (and other things I may need to remember). This blog is primarily for my own reference, but if the information I found is useful to others, then that is great. If others want to contribute with comments or other information, then that is great too.
Showing posts with label String. Show all posts
Showing posts with label String. Show all posts
Thursday, January 24, 2013
Friday, June 5, 2009
Converting a Byte Array to a String in VB.NET
Here is one way to convert a byte array to a String in VB.NET:
Dim bArray() As Byte = {65, 66, 67, 68, 69}
Dim str As String
str = System.Text.Encoding.ASCII.GetString(bArray)
More examples of converting Byte Arrays to Strings and vice versa in VB.NET and C# can be found here:
http://www.chilkatsoft.com/faq/DotNetStrToBytes.html
Dim bArray() As Byte = {65, 66, 67, 68, 69}
Dim str As String
str = System.Text.Encoding.ASCII.GetString(bArray)
More examples of converting Byte Arrays to Strings and vice versa in VB.NET and C# can be found here:
http://www.chilkatsoft.com/faq/DotNetStrToBytes.html
Labels:
Byte Array,
String
Subscribe to:
Posts (Atom)