Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 403
  • Last Modified:

VB.Net 2005 - Trying to use Fixed Column Length variables???

I need to create an output text file with fixed length columns. I'm not sure how to do that in VB.Net 2005. I'm thinking that I could write a routine where I pass the variable, the length the column needs to be, the data type (string or number), and then somehow return a variable with a padded value.

Anyone have any ideas on how to do this easier....I'm all ears!!!!

Thanks,
Blake
0
BlakeMcKenna
Asked:
BlakeMcKenna
1 Solution
 
CodeFishCommented:
use the PadLeft/PadRight method of string:

Dim pString as String = "ABC"
pString = pString.PadRight(12)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now