|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Format FunctionIn VB6 you could use the format function to format strings using the @ and !
symbols. for example format("LEE", "!@@@@@@@@") would left align the string "LEE" to the number of spaces allowed in the repeatings @'s. Has this functionality disappeared in the format function for .NET, if so where has it gone? Lee,
One option might be to use String.PadLeft and/or String.PadRight. Kerry Moorman Show quoteHide quote "Lee" wrote: > In VB6 you could use the format function to format strings using the @ and ! > symbols. for example format("LEE", "!@@@@@@@@") would left align the string > "LEE" to the number of spaces allowed in the repeatings @'s. Has this > functionality disappeared in the format function for .NET, if so where has it > gone? "Lee" <L**@discussions.microsoft.com> wrote in message You can use the String.Format function to get the same results.news:7D04204B-3FE4-4F8F-A7D4-4053D3B2C102@microsoft.com... > In VB6 you could use the format function to format strings using the @ and > ! > symbols. for example format("LEE", "!@@@@@@@@") would left align the > string > "LEE" to the number of spaces allowed in the repeatings @'s. Has this > functionality disappeared in the format function for .NET, if so where has > it > gone? Using {0,-100} or {0, 100} to left/right align. Dim input As String = "Test" Dim result As String result = String.Format("{0,-10}", input) ' result now contains "Test " result = String.Format("{0,10}", input) ' result now contains " Test" HTH, Mythran I believe I found the answer to be LSET and RSET functions.
Thanks for your replies. "Lee" <L**@discussions.microsoft.com> wrote in message You should really check out the String.Format function :) It will do what news:F9AF101B-A00A-45F2-865E-BB8AE318F1F2@microsoft.com... >I believe I found the answer to be LSET and RSET functions. > > Thanks for your replies. you want, and MORE! :) Mythran
simple combo question
ImageList - Memory-Issue in vs2005 Strange error - help needed VB (5or6) does something wierd with image data Redirect question FileSystemWatcher any experts here? General Design Question - Class Name Upgrading to VS 2005 compatibility with 2003 What happened with module variables? Measuring the degree of sortedness of an array... |
|||||||||||||||||||||||