Solved

Convert some characters to uppercase.

Posted on 2006-11-30
3
166 Views
Last Modified: 2010-04-05
Hello,
I would like some suggestions on the simplest function/procedure to do the following.
I have a string as follows;

This/is_my/test string.

I need it to be changed to this
This/Is_My/Test String.

Essentially I need to search for all occurences of '/' '_' and spaces, and uppercase the character following.
Hope this makes sense.
0
Comment
Question by:RickJ
  • 2
3 Comments
 
LVL 19

Accepted Solution

by:
MerijnB earned 500 total points
Comment Utility
function RickJsUpperCase(St: string): string;
 const Delimiters: set of char = ['_', '/', ' '];
 var i: integer;
 begin
  result := St;

  for i := 1 to Length(result) - 1 do
   if result[i] in Delimiters then
    result[i + 1] := UpCase(result[i + 1]);
 end;
0
 
LVL 19

Expert Comment

by:MerijnB
Comment Utility
usage:
var st: string;
begin
 st := RickJsUpperCase('This/is_my/test string.');
 form1.caption := st; // st is now 'This/Is_My/Test String.'
end;
0
 
LVL 8

Author Comment

by:RickJ
Comment Utility
Cool, thanks MerijnB
Works for me.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

763 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

9 Experts available now in Live!

Get 1:1 Help Now