Re: Replace the 1st Character in every word

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Amar (margelos_at_gmail.com)
Date: 11/19/04


Date: 19 Nov 2004 00:11:54 -0800

Even though i cannot understand you want to do that here is a sample.

string str = "horse";
string newstr = str.Replace(str.Substring(0,1),str.Substring(0,1).ToUpper());

"JrMc" <JrMc@discussions.microsoft.com> wrote in message news:<9E46FBD0-C39F-4C8C-AD61-A1669A62BA38@microsoft.com>...
> I am new to this .net environement. I'm needing to do a simple task - I
> need to read the first character of a word and replace it with an uppercase.
> Example:
>
> "horse" --> change to "Horse"
>
> I can do this on an as/400 using RPG, but cannot figure out the syntax to do
> it in .net with the .substring and .toupper methods.



Relevant Pages

  • Re: forgetting my DCL: what am I missing?
    ... The CLI version supports the UN*X-like syntax as well. ... It does if the first character is "-". ... this is not necessarily the case with the unix syntax. ...
    (comp.os.vms)
  • Syntax based recognition of comments
    ... syntax table. ... appears that there is no way to learn via char-syntax that a character ... is the first character of an opening comment sequence. ...
    (comp.emacs.xemacs)
  • Re: forgetting my DCL: what am I missing?
    ... The CLI version supports the UN*X-like syntax as well. ... It does if the first character is "-". ... this is not necessarily the case with the unix syntax. ...
    (comp.os.vms)
  • Re: using do loop to format text boxes
    ... test the first character for a '_'? ... being within the "with" loop I can't get the syntax right. ... > Dim lngI As Long ...
    (microsoft.public.access.reports)