Visual Studio - Sentence Case

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jewel

    #1

    Visual Studio - Sentence Case

    hi all

    sorry if this is in the wrong group -

    I have just started using Visual Studio.net 2003 - MSDN reporting tools - I
    come from a MS Access Background

    I need to verify sentence case

    eg emailid - should show John.Smith@aaaa .co.nz - and not
    john.smith@aaaa .co.nz

    how do I set this up

    my fields will be:
    SELECT clientcode // firstname // lastname // emailid
    FROM client
    WHERE client.emailid ?????????

    well I am presuming this is where I am heading!

    thanks

  • Morten Wennevik

    #2
    Re: Visual Studio - Sentence Case

    Hi Jewel,

    You could use String.ToLower on the address.

    string s = "John.Smith@aaa a.co.nz";
    s = s.ToLower();


    --
    Happy Coding!
    Morten Wennevik [C# MVP]

    Comment

    • clintonG

      #3
      Re: Visual Studio - Sentence Case

      Morten gives half the answer. First change all characters to lower
      case as he explains, then use the TitleCase method of the TextInfo
      class as this article [1] explains. Doing so would be one way
      to obtain 'validated' results.

      Google: "sentence case"+"asp.net"

      --
      <%= Clinton Gallagher, "Twice the Results -- Half the Cost"
      Architectural & e-Business Consulting -- Software Development
      NET csgallagher@REM OVETHISTEXTmetr omilwaukee.com
      URL http://www.metromilwaukee.com/clintongallagher/

      [1] http://www.codeassist.com/Default.as...5&g=posts&t=52



      "Morten Wennevik" <MortenWennevik @hotmail.com> wrote in message
      news:opsf9c7teg klbvpo@pbn_comp uter...[color=blue]
      > Hi Jewel,
      >
      > You could use String.ToLower on the address.
      >
      > string s = "John.Smith@aaa a.co.nz";
      > s = s.ToLower();
      >
      >
      > --
      > Happy Coding!
      > Morten Wennevik [C# MVP][/color]


      Comment

      • clintonG

        #4
        Re: Visual Studio - Sentence Case

        Morten gives half the answer. First change all characters to lower
        case as he explains, then use the TitleCase method of the TextInfo
        class as this article [1] explains. Doing so would be one way
        to obtain 'validated' results.

        Google: "sentence case"+"asp.net"

        --
        <%= Clinton Gallagher, "Twice the Results -- Half the Cost"
        Architectural & e-Business Consulting -- Software Development
        NET csgallagher@REM OVETHISTEXTmetr omilwaukee.com
        URL http://www.metromilwaukee.com/clintongallagher/

        [1] http://www.codeassist.com/Default.as...5&g=posts&t=52



        "Morten Wennevik" <MortenWennevik @hotmail.com> wrote in message
        news:opsf9c7teg klbvpo@pbn_comp uter...[color=blue]
        > Hi Jewel,
        >
        > You could use String.ToLower on the address.
        >
        > string s = "John.Smith@aaa a.co.nz";
        > s = s.ToLower();
        >
        >
        > --
        > Happy Coding!
        > Morten Wennevik [C# MVP][/color]


        Comment

        • Rachel

          #5
          RE: Visual Studio - Sentence Case

          Hi Jewel,

          Ok, you want to know about Proper case for the name and Lower case for the
          email address. This is found in a handy function called StrConv. Please see
          the code snippet below as an example of how StrConv is used.

          Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
          System.EventArg s) Handles Button1.Click

          Dim strFirstName As String
          Dim strLastName As String
          Dim strEmailId As String
          Dim strEmailAddress As String
          strFirstName = "JOHN"
          strLastName = "SMITH"
          strEmailId = "AOL.COM"
          strFirstName = StrConv(strFirs tName, VbStrConv.Prope rCase)
          strLastName = StrConv(strLast Name, VbStrConv.Prope rCase)
          strEmailId = StrConv(strEmai lId, VbStrConv.Lower Case)
          strEmailAddress = strFirstName & strLastName & "@" & strEmailId

          MsgBox(strEmail Address, MsgBoxStyle.Inf ormation, "Example")

          End Sub

          Rachel Kozlowski

          "Jewel" wrote:
          [color=blue]
          > hi all
          >
          > sorry if this is in the wrong group -
          >
          > I have just started using Visual Studio.net 2003 - MSDN reporting tools - I
          > come from a MS Access Background
          >
          > I need to verify sentence case
          >
          > eg emailid - should show John.Smith@aaaa .co.nz - and not
          > john.smith@aaaa .co.nz
          >
          > how do I set this up
          >
          > my fields will be:
          > SELECT clientcode // firstname // lastname // emailid
          > FROM client
          > WHERE client.emailid ?????????
          >
          > well I am presuming this is where I am heading!
          >
          > thanks
          >[/color]

          Comment

          Working...