Solved

Convert some characters to uppercase.

Posted on 2006-11-30
3
171 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 19

Accepted Solution

by:
MerijnB earned 500 total points
ID: 18043774
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
ID: 18043783
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
ID: 18043868
Cool, thanks MerijnB
Works for me.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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…
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

749 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