Solved

Lower Case a string

Posted on 2001-08-23
12
530 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
 

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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now