Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Manipulating Strings.

Posted on 2004-04-07
2
Medium Priority
?
235 Views
Last Modified: 2010-04-15
For example my String is:

  This is a sample message

 
I want my final stiring to be :

     ThisIsASampleMessage


i need to remove spaces and capitalize the first letter of each word.

any help would be appreciated.  if you can write some code to do this, would be great.

steve.
0
Comment
Question by:steve_mick972
[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
2 Comments
 
LVL 2

Accepted Solution

by:
jeffqyzt earned 2000 total points
ID: 10777502

         string sIn = "This is a sample message";
         string sOut = string.Empty;

         string[] sArr = sIn.Split(' ');
         
         for (int i = 0 ; i < sArr.Length ; i++)
         {
            sOut += sArr[i].Substring(0,1).ToUpper();
            if (sArr[i].Length > 1)
               sOut += sArr[i].Substring(1, sArr[i].Length -1);                                      
         }
0
 
LVL 2

Expert Comment

by:jeffqyzt
ID: 10778082
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

609 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