Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Replace Loop?


Reply
 
Thread Tools Display Modes
  #1  
Old 08-21-2003, 08:46 PM
Line's Avatar
Line Line is offline
Centurion
 
Join Date: Jun 2003
Location: Michigan
Posts: 165
Default Replace Loop?


I currently have this as a "Caps" to "lowercase" converter

Code:
Private Sub Command1_Click() Text1.Text = Replace(Text1.Text, "A", "a") Text1.Text = Replace(Text1.Text, "B", "b") Text1.Text = Replace(Text1.Text, "C", "c") Text1.Text = Replace(Text1.Text, "D", "d") Text1.Text = Replace(Text1.Text, "E", "e") Text1.Text = Replace(Text1.Text, "F", "f") Text1.Text = Replace(Text1.Text, "G", "g") Text1.Text = Replace(Text1.Text, "H", "h") Text1.Text = Replace(Text1.Text, "I", "i") Text1.Text = Replace(Text1.Text, "J", "j") Text1.Text = Replace(Text1.Text, "K", "k") Text1.Text = Replace(Text1.Text, "L", "l") Text1.Text = Replace(Text1.Text, "M", "m") Text1.Text = Replace(Text1.Text, "N", "n") Text1.Text = Replace(Text1.Text, "O", "o") Text1.Text = Replace(Text1.Text, "P", "p") Text1.Text = Replace(Text1.Text, "Q", "q") Text1.Text = Replace(Text1.Text, "R", "r") Text1.Text = Replace(Text1.Text, "S", "s") Text1.Text = Replace(Text1.Text, "T", "t") Text1.Text = Replace(Text1.Text, "U", "u") Text1.Text = Replace(Text1.Text, "V", "v") Text1.Text = Replace(Text1.Text, "W", "w") Text1.Text = Replace(Text1.Text, "X", "x") Text1.Text = Replace(Text1.Text, "Y", "y") Text1.Text = Replace(Text1.Text, "Z", "z") End Sub

Is there a way to shorten this? (im guessing a loop or something)
__________________
I like watching paint dry.
I like watching other peoples paint dry.
Reply With Quote
  #2  
Old 08-21-2003, 08:47 PM
MikeJ's Avatar
MikeJ MikeJ is offline
Retread

Retired Moderator
* Expert *
 
Join Date: Sep 2002
Location: Austin, Texas
Posts: 6,742
Default

Or LCase$.


~MikeJ
__________________
{ Lex Fori } { Locus Classicus } { Rutilus Scrinium }
Osculare pultem meam!
Reply With Quote
  #3  
Old 08-21-2003, 08:53 PM
reboot's Avatar
reboot reboot is offline
Keeper of foo

Retired Moderator
* Guru *
 
Join Date: Nov 2001
Location: Graceland
Posts: 15,612
Default

i.e. Text1.Text = LCase$(Text1.Text)

Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Standards and Practices loquin Tutors' Corner 10 07-28-2006 12:16 PM
Hot Keys exiting a loop Blaggut General 12 08-08-2003 07:57 AM
vc++6: any1 know how to use threads eg _beginthread(), _endthread() funcs clockworkorange Miscellaneous Languages 2 06-09-2003 09:20 PM
dx main loop Waxycat Miscellaneous Languages 3 02-25-2002 02:28 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->