Solved

Lower Case a string

Posted on 2001-08-23
12
532 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
delphi parse string to params 3 122
Press three keys together and trigger a function 3 56
Delphi: Connect to running MS Outlook 4 82
PHP preg_replace code convert to Delphi 14 55
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

786 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