Space() in C#

  • Thread starter Thread starter mike parr
  • Start date Start date
M

mike parr

What is the equivalent of Space in C#?

Space(10 - Len(Trim(txtAccessAccountsID.Text)))


Thanks,

Mike
 
mike parr said:
What is the equivalent of Space in C#?
Space(10 - Len(Trim(txtAccessAccountsID.Text)))

Based on your example, it would seem Jochen's response is whatyou are
looking for, but, in the interest of completeness, the closest thing to the
Space() function in .Net is one of String's constructors:

int n = 10;
String Spc10 = new String(' ', n); // creates a string of n
spaces.

--
Truth,
James Curran
Home: www.noveltheory.com Work: www.njtheater.com
Blog: www.honestillusion.com Day Job: www.partsearch.com
(note new day job!)
 
Thanks Jochen, James

I went with PadRight :

string strAdConCode = strCUCode.PadRight(10, ' ') + '1';


Cheers,

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top