Character string question

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

    Character string question

    hi there:

    I have a question that how to get the character strings length.I want to get byte number about that character strings.

    Any advice I appreciate your help

    regards jiangyh
  • jiangyh

    #2
    Re: Character string question

    hi there :


    I already resolve this question like buttom


    Encoding uniCode = Encoding.Unicod e;
    byte[] inputByte = uniCode.GetByte s(_inputValue);
    Int64 byteLength = inputByte.Lengt h


    "jiangyh" <ca___t@msn.com > дÈëÓʼþ news:%23E2A4Bku EHA.1392@tk2msf tngp13.phx.gbl. ..
    hi there:

    I have a question that how to get the character strings length.I want to get byte number about that character strings.

    Any advice I appreciate your help

    regards jiangyh

    Comment

    • jiangyh

      #3
      Re: Character string question

      hi guys:


      only have a little question,if I get the string type length,is true,but if I want get int and string length,is wrong.

      how to get 2004/04/04 length.

      thank you very much
      "jiangyh" <ca___t@msn.com > дÈëÓʼþ news:%23E2A4Bku EHA.1392@tk2msf tngp13.phx.gbl. ..
      hi there:

      I have a question that how to get the character strings length.I want to get byte number about that character strings.

      Any advice I appreciate your help

      regards jiangyh

      Comment

      • Jon Skeet [C# MVP]

        #4
        Re: Character string question

        jiangyh <ca___t@msn.com > wrote:[color=blue]
        > I have a question that how to get the character strings length.I want
        > to get byte number about that character strings.[/color]

        Number of bytes in which encoding though?

        The length of a string in *characters* is available through just the
        Length property.

        --
        Jon Skeet - <skeet@pobox.co m>
        Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

        If replying to the group, please do not mail me too

        Comment

        Working...