 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
jonathan2260
Joined: 13 May 2008 Posts: 7
|
Posted: Tue May 27, 2008 3:52 pm Post subject: Converting first 2 letters to upper case |
|
|
I'm looking for a way to convert the 1st 2 letters of the A_username variable from lower case to upper case for a login issue.
Ex: username jdoe would become JDoe
I imagine using either the StringUpper or StringReplace command and dump it into another variable to do so but do not see how I would apply the commands.
Thank You for the help. |
|
| Back to top |
|
 |
Trikster
Joined: 15 Jul 2007 Posts: 1224 Location: Enterprise, Alabama
|
Posted: Tue May 27, 2008 4:46 pm Post subject: |
|
|
| Code: | String_Test = test.
String := SubStr(String_Test, 1, 2)
StringUpper, String, String
MsgBox, % String . SubStr(String_Test, 3, StrLen(String_Test)) |
_________________ ScriptPad | ~dieom | dieom | izwian2k7 | Ian | God |
|
| Back to top |
|
 |
SKAN! Guest
|
Posted: Tue May 27, 2008 8:59 pm Post subject: |
|
|
| Code: | Username := DllCall( "CharUpperA", Str,SubStr(A_UserName,1,2),Str) . SubStr(A_UserName,3)
MsgBox, % UserName |
 |
|
| Back to top |
|
 |
DerRaphael
Joined: 23 Nov 2007 Posts: 604 Location: 127.0.0.1
|
Posted: Wed May 28, 2008 2:56 pm Post subject: |
|
|
| Code: | | MsgBox % name := RegExReplace(name:="jdoe","(^.{2})", "$U1") |
results is a MsgBox displaying JDoe. using it with A_UserName, looks like this:
| Code: | | MsgBox % RegExReplace(A_UserName,"(^.{2})", "$U1") |
greets
derRaphael _________________
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|