Computing.Net > Forums > Programming > Echo Text in Caps

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Echo Text in Caps

Reply to Message Icon

Name: astroraptor
Date: June 23, 2008 at 11:38:29 Pacific
OS: Windows XP Pro
CPU/Ram: 1.8GHz/1024MB
Product: IBM/NetVista
Comment:

Not terribly important but is there a way to take a text variable and change it into caps?



Sponsored Link
Ads by Google

Response Number 1
Name: StuartS
Date: June 23, 2008 at 12:09:36 Pacific
Reply:

Depends on which programming language you are using. Most languages have a function to change text to all upper case or all lower case as needed.

For instance in VB it is Ucase (variable) or Lcase (variable).

Stuart


0

Response Number 2
Name: astroraptor
Date: June 23, 2008 at 13:01:46 Pacific
Reply:

lol yikes! I thought I had written Batch in the title. :|


0

Response Number 3
Name: devil_himself
Date: June 24, 2008 at 00:06:44 Pacific
Reply:

@echo off
setlocal enabledelayedexpansion
set var=%~1
for %%a in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
set var=!var:%%a=%%a!
)


0

Response Number 4
Name: ghostdog
Date: June 24, 2008 at 08:42:18 Pacific
Reply:

anything that can be run by cmd is called "batch", according to my definition.

with vbscript


Set objArgs = WScript.Arguments
WScript.Echo UCase(objArgs(I))

save the above as script.vbs and in your batch file,


@echo off
....
....
cscript /nologo script.vbs %%variable


0

Response Number 5
Name: astroraptor
Date: June 24, 2008 at 09:18:40 Pacific
Reply:

Okay well, Windows NT Command-Line Script. :P And yes, I do use VBScript when I just can't get something to work the way I want it to. Thanks you two.


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Echo Text in Caps

echo text to specific line in file www.computing.net/answers/programming/echo-text-to-specific-line-in-file/11965.html

Find and Replace text in Batch File www.computing.net/answers/programming/find-and-replace-text-in-batch-file/12413.html

Voice Text in VB 6.0 www.computing.net/answers/programming/voice-text-in-vb-60/5924.html