Upper and lower case words 
Author Message
 Upper and lower case words

Is there a function available that will upper and lower
case the words.

Example.

'This is a test example.'

The funtion will need to convert the above sentence to
'This Is A Test Example.'

I know how to write the function but if there was a
function that already exists then I could use it.



Fri, 28 Jan 2005 17:39:40 GMT  
 Upper and lower case words
this.textbox1.Text.ToUpper();


Quote:
> Is there a function available that will upper and lower
> case the words.

> Example.

> 'This is a test example.'

> The funtion will need to convert the above sentence to
> 'This Is A Test Example.'

> I know how to write the function but if there was a
> function that already exists then I could use it.



Fri, 28 Jan 2005 18:12:32 GMT  
 Upper and lower case words
I need to convert each word in upper and lower case. iE 'Hello World'
rather than 'HELLO WORLD'

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Fri, 28 Jan 2005 19:04:07 GMT  
 Upper and lower case words

Quote:

> Is there a function available that will upper and lower
> case the words.

> Example.

> 'This is a test example.'

> The funtion will need to convert the above sentence to
> 'This Is A Test Example.'

> I know how to write the function but if there was a
> function that already exists then I could use it.

One way is to use a regular expression and the Replace method with a
delegate that converts the word beginnings to upper case. Here is an example

using System.Text.RegularExpressions;

public class MatchEvaluatorTest {
   public static string ToUpperWord (Match match) {
     return match.Value.ToUpper();
   }
   public static void Main () {
     string sentence = "kibology for all. all for kibology.";

     string newSentence = re.Replace(sentence, new
MatchEvaluator(ToUpperWord));
     System.Console.WriteLine("Original sentence: {0}\nTransformed
sentence: {1}", sentence, newSentence);
   }

Quote:
}

--

        Martin Honnen
        http://javascript.faqts.com/
        http://home.t-online.de/home/martin.honnen/jsgoddies.html



Fri, 28 Jan 2005 19:37:33 GMT  
 Upper and lower case words
He's looking for proper casing, not upper casing.

No such animal in C#.  Even in languages that provide this, it's usually just a
simple-minded function that's not intelligent about a given language, so you're
better off to roll your own.

--Bob Grommes

Quote:

> this.textbox1.Text.ToUpper();



> > Is there a function available that will upper and lower
> > case the words.

> > Example.

> > 'This is a test example.'

> > The funtion will need to convert the above sentence to
> > 'This Is A Test Example.'

> > I know how to write the function but if there was a
> > function that already exists then I could use it.



Fri, 28 Jan 2005 22:37:53 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. moving upper case names to lower case

2. Upper case / lower case problem in IDL file

3. Fastest way to convert lower to upper case?

4. Select returning UPPER & LOWER CASE

5. STL string to upper/lower case

6. upper/lower case with VMS C

7. Finding the respective upper and lower bytes in memory of a short unsigned int

8. lower to UPPER

9. strings: lower & upper

10. Lower to Upper

11. Lower to upper

12. Convert keypress to upper case

 

 
Powered by phpBB® Forum Software