Important alert: (current site time 7/15/2013 8:44:35 AM EDT)
 

VB icon

ALTERNATIVE TOUPPER AND TOLOWER FUNCTIONS

Email
Submitted on: 12/15/2003 3:20:55 AM
By: barkýn ünüulu  
Level: Beginner
User Rating: By 3 Users
Compatibility: VB.NET
Views: 10628
author picture
(About the author)
 
     Purpose of this code is togive an alternative to the TOLOWER and TOUPPER methods vb.net uses...
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
//**************************************
// Name: ALTERNATIVE TOUPPER AND TOLOWER FUNCTIONS
// Description:Purpose of this code is togive an alternative to the TOLOWER and TOUPPER methods vb.net uses...
// By: barkýn ünüulu
//
//This code is copyrighted and has// limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=1890&lngWId=10//for details.//**************************************

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a As String
Dim h As String
Dim f As String
Dim b As String
Dim c As Long
Dim i As Long = 1
Dim m As New MakeBigOrLittle()
Dim k As String
Dim z As String
b = TextBox1.Text
c = Len(b)
Do
a = Microsoft.VisualBasic.Left(b, 1)
h = Microsoft.VisualBasic.Right(b, c - i)
'b = ""
b = h
f = m.ToBig(a)
ListBox1.Items.Add(f)
i = i + 1
Loop While i < c
'Console.ReadLine()
'Console.ReadLine()
k = Microsoft.VisualBasic.Right(b, 1)
z = m.ToBig(k)
ListBox1.Items.Insert(c - 1, z)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim a As String
Dim h As String
Dim f As String
Dim b As String
Dim c As Long
Dim i As Long = 1
Dim m As New MakeBigOrLittle()
Dim k As String
Dim z As String
b = TextBox1.Text
c = Len(b)
Do
a = Microsoft.VisualBasic.Left(b, 1)
h = Microsoft.VisualBasic.Right(b, c - i)
'b = ""
b = h
f = m.ToLittle(a)
ListBox1.Items.Add(f)
i = i + 1
Loop While i < c
'Console.ReadLine()
'Console.ReadLine()
k = Microsoft.VisualBasic.Right(b, 1)
z = m.ToLittle(k)
ListBox1.Items.Insert(c - 1, z)
End Sub
End Class
Public Class MakeBigOrLittle
Dim character As String
Public Function ToBig(ByVal Str As String)
Select Case Str
Case "a"
character = "A"
Case "b"
character = "B"
Case "c"
character = "C"
Case "d"
character = "D"
Case "e"
character = "E"
Case "f"
character = "F"
Case "g"
character = "G"
Case "h"
character = "H"
Case "i"
character = "I"
Case "j"
character = "J"
Case "k"
character = "K"
Case "l"
character = "L"
Case "m"
character = "M"
Case "n"
character = "N"
Case "o"
character = "O"
Case "p"
character = "P"
Case "r"
character = "R"
Case "s"
character = "S"
Case "t"
character = "T"
Case "u"
character = "U"
Case "v"
character = "V"
Case "w"
character = "W"
Case "x"
character = "X"
Case "y"
character = "Y"
Case "z"
character = "Z"
End Select
Return character
End Function
Public Function ToLittle(ByVal str As String)
Select Case str
Case "A"
character = "a"
Case "B"
character = "b"
Case "C"
character = "c"
Case "D"
character = "d"
Case "E"
character = "e"
Case "F"
character = "f"
Case "G"
character = "g"
Case "H"
character = "h"
Case "I"
character = "i"
Case "J"
character = "j"
Case "K"
character = "k"
Case "L"
character = "l"
Case "M"
character = "m"
Case "N"
character = "n"
Case "O"
character = "o"
Case "P"
character = "p"
Case "R"
character = "r"
Case "S"
character = "s"
Case "T"
character = "t"
Case "U"
character = "u"
Case "V"
character = "v"
Case "W"
character = "w"
Case "X"
character = "x"
Case "Y"
character = "y"
Case "Z"
character = "z"
End Select
Return character
End Function
End Class


Other 12 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

12/15/2003 10:35:12 AMundercodex

Making ascii code shifting will be a faster solution instead of this case statements.
(If this comment was disrespectful, please report it.)

 
12/16/2003 4:18:37 AMGarfield_x

why should we use this if the vb.net function is much faster and easier to use??
(If this comment was disrespectful, please report it.)

 
12/16/2003 5:47:42 AMKen Harvey

you+have+to+be+joking%3F+learn+the+%2ENET+Framework+and+stick+to+the+String%2EToUpper%28 %29+and+String%2EToLower%28%29+shared+methods%2E
(If this comment was disrespectful, please report it.)

 
12/16/2003 5:49:47 AMKen Harvey

you have to be joking. learn the .NET Framework and stick to the String.ToUpper() and String.ToLower() shared methods. -- saying that, well done on your beginner submission.
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.