.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 23rd, 2007, 07:35 AM
buzz44 buzz44 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2007
Posts: 1 buzz44 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
StringBuilder.AppendFormat(format as String, ParamArray args() as Object) usage...

Howdy,

My first post .

I want to use the overloaded version of the AppendFormat method in the title to this thread but I really don't see the point.

The AppendFormat format argument requires you to use the syntax {N} where N is the index of the parameter you want to format.

I want to do something like this...

Code:
    Protected Function SetPacketData(ByVal ParamArray Parameters() As Object) As String

        Dim PacketData As New System.Text.StringBuilder

        PacketData.AppendFormat("{0}", Parameters)

        Return PacketData.ToString()

    End Function


Obviously "{0}" will only format the first index in the parameters array, so what is the point of having this overloaded method if the format argument *needs to know* the index it needs to format, and a ParamArray can have X amount of elements? I want to format the whole Parameters() object at once? To get around this I have to use a For loop and loop through each element of Parameters().

Has anyone else encountered this problem before and has a viable solution (if any)?

Thanks.

Edit:

I ended up doing it the long way.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > StringBuilder.AppendFormat(format as String, ParamArray args() as Object) usage...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT