String Function.

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

    String Function.

    Hi all,
    whats the equalient string function in vb.net?

    VB:
    MyString = String(10, "ABC") ' Returns "AAAAAAAAAA ".

    Thanks
    Bala

  • Ken Tucker [MVP]

    #2
    Re: String Function.

    Hi,

    Dim myString As New String("ABC", 10)



    Ken

    ----------------------

    "Bala" <Bala@discussio ns.microsoft.co m> wrote in message
    news:7995D850-D19A-43E7-987F-74C3A0C122FF@mi crosoft.com...
    Hi all,
    whats the equalient string function in vb.net?

    VB:
    MyString = String(10, "ABC") ' Returns "AAAAAAAAAA ".

    Thanks
    Bala


    Comment

    • Crouchie1998

      #3
      Re: String Function.

      If you want to repeat a character then you can always do it this way too:

      Dim strRepeated As String = StrDup(10, "A")

      "Ken Tucker [MVP]" wrote:
      [color=blue]
      > Hi,
      >
      > Dim myString As New String("ABC", 10)
      >
      >
      >
      > Ken
      >
      > ----------------------
      >
      > "Bala" <Bala@discussio ns.microsoft.co m> wrote in message
      > news:7995D850-D19A-43E7-987F-74C3A0C122FF@mi crosoft.com...
      > Hi all,
      > whats the equalient string function in vb.net?
      >
      > VB:
      > MyString = String(10, "ABC") ' Returns "AAAAAAAAAA ".
      >
      > Thanks
      > Bala
      >
      >
      >[/color]

      Comment

      • Herfried K. Wagner [MVP]

        #4
        Re: String Function.

        "Crouchie19 98" <Crouchie1998@d iscussions.micr osoft.com> schrieb:[color=blue]
        > If you want to repeat a character then you can always do it this way too:
        >
        > Dim strRepeated As String = StrDup(10, "A")[/color]

        Alternatively you can pass "A" as a character ('"A"c').

        --
        M S Herfried K. Wagner
        M V P <URL:http://dotnet.mvps.org/>
        V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

        Comment

        • Bala

          #5
          Re: String Function.

          Thanks a lot.
          bala

          "Herfried K. Wagner [MVP]" wrote:
          [color=blue]
          > "Crouchie19 98" <Crouchie1998@d iscussions.micr osoft.com> schrieb:[color=green]
          > > If you want to repeat a character then you can always do it this way too:
          > >
          > > Dim strRepeated As String = StrDup(10, "A")[/color]
          >
          > Alternatively you can pass "A" as a character ('"A"c').
          >
          > --
          > M S Herfried K. Wagner
          > M V P <URL:http://dotnet.mvps.org/>
          > V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
          >[/color]

          Comment

          Working...