hulken
asked on
Lower Case a string
How do I use delphi's editor to search for a string and lower-case it.
(query-replace)
(query-replace)
You can do it even easier: use the Search -> Replace (CTRL+R), and enter the string you want to lowercase in both fields as lowercase. Make sure that none of the Options are checked, and hit "Replace All".
AvonWyss is right :-)
I assumed this was a regular expression search; if the search string is 'static' then the replace string is, too.
:-)
I assumed this was a regular expression search; if the search string is 'static' then the replace string is, too.
:-)
ASKER
If I wan't to lowercase all that I have marked in a unit ?
it seems like ctrl+k ctrl+e don't allow me to select all in a text-file and lowercase it.
it seems like ctrl+k ctrl+e don't allow me to select all in a text-file and lowercase it.
You're right, Ctrl+K, Ctrl+E only lowercases words. If the selection is bigger, only the last word is lowercased. I didn't know this...
You could write a keybinging to do what you want.
There's a demo in Demos\ToolsAPI\Editor Keybinding
There's a demo in Demos\ToolsAPI\Editor Keybinding
To lowercase a selection, use CTRL-K + O
Cool AvonWyss, did you find that in the help file?
I can't find it...
I can't find it...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thnks for the help
Thanks for the link :-)
You're all welcome!
A keyboard macro could make it easier. In the following example, I suppose you are using the Default key mapping.
1. Do your first search manually. Delphi will highlight the found occurence and the caret will be positioned next to it.
2. Start recording a macro by pressing Ctrl+Shift+R.
3. Select the found occurrence with Shift+arrows or if it's a whole token you can use Ctrl+K, Ctrl+T.
4. Lowercase the selection with Ctrl+K, Ctrl+E.
5. Search for the next occurrence with F3.
6. Stop recording by pressing Ctrl+Shift+R again.
7. Play your macro with Ctrl+Shift+P. Repeat until no more occurrencies are found.
HTH
TOndrej