Solved

Lower Case a string

Posted on 2001-08-23
12
533 Views
Last Modified: 2010-04-06
How do I use delphi's editor to search for a string and lower-case it.
(query-replace)
0
Comment
Question by:hulken
  • 6
  • 4
  • 2
12 Comments
 
LVL 8

Expert Comment

by:TOndrej
ID: 6416571
I suppose you are talking about multiple occurencies of the search string.
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
0
 
LVL 14

Expert Comment

by:AvonWyss
ID: 6416737
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".
0
 
LVL 8

Expert Comment

by:TOndrej
ID: 6416748
AvonWyss is right :-)

I assumed this was a regular expression search; if the search string is 'static' then the replace string is, too.

:-)
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:hulken
ID: 6416829
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.
0
 
LVL 8

Expert Comment

by:TOndrej
ID: 6416883
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...
0
 
LVL 8

Expert Comment

by:TOndrej
ID: 6416885
You could write a keybinging to do what you want.
There's a demo in Demos\ToolsAPI\Editor Keybinding
0
 
LVL 14

Expert Comment

by:AvonWyss
ID: 6416945
To lowercase a selection, use CTRL-K + O
0
 
LVL 8

Expert Comment

by:TOndrej
ID: 6416957
Cool AvonWyss, did you find that in the help file?
I can't find it...
0
 
LVL 14

Accepted Solution

by:
AvonWyss earned 50 total points
ID: 6417064
No, that's just basic knowledge... ;-)

http://community.borland.com/article/0,1410,19549,00.html
0
 

Author Comment

by:hulken
ID: 6417066
thnks for the help
0
 
LVL 8

Expert Comment

by:TOndrej
ID: 6417067
Thanks for the link :-)
0
 
LVL 14

Expert Comment

by:AvonWyss
ID: 6417074
You're all welcome!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Help on project with Soap 10 57
Intraweb download file link ? 1 156
Firemonkey DbLookupComboBox equivalent ? 2 56
Delphi: making a BW image transparent 10 63
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question