Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5934851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:10:18+00:00 2026-05-22T15:10:18+00:00

I have followed this WordPress tutorial which works great. I have used a listview

  • 0

I have followed this WordPress tutorial which works great. I have used a listview and when i try to format the string it doesn’t recognise the \t (but does recognise \n). It also won’t recognise String.Format etc.

Is there anyway that I can format the string using tabs or something similar?

Cheers

EDIT

for( i = 0; i < lstView.Items.Count;i++) 
{ 
    name = lstView.Items[i].Text; 
    state = lstView.Items[i].SubItems[1].Text; 
    country = lstView.Items[i].SubItems[2].Text; 
    line += name + "\t" + state + "\t" + country + "\n"; 
}  
StringReader reader = new StringReader(line); 

When line is used to print the string is joined together so the \t doesn’t work. The \n for a new line does work though. Does anyone know any way that I can format the string without using spaces.

The result is like this

NameStateCountry

LongernameStateCountry

anotherNameAnotherStateAnotherCountry

Where I would like them lined up (like in a table) with name one column, state another column and country then third

Any suggestions greatly appreciated

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:10:19+00:00Added an answer on May 22, 2026 at 3:10 pm

    Well, it is a bit odd that tabs are lost, but on the other hand, tabs will probably be problematic if the individual string elements (name, state etc.) varies in length.
    What you could do instead is use string.Format() and use fixed column widths.
    To get nice visual output this would include a parse step to determine the correct column width.
    When this is done, use something like this to use spaces instead of tabs.

    string line = string.Format("{0,-20}{1,-20}{2,-20}", "name", "state", "country");
    

    EDIT: Saw that you did not want to use spaces.
    In this case, you will probably need to handle this in the printing algorithm itself. You could still separate items with tabs, then for each line split it on tabs, creating an array of items (columns) per line.
    For each item, print it using Graphics.DrawString() with a suitable X-position offset.

    See the documentation for Graphics.DrawString.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have followed this tutorial which allowed me to create a Silverlight DataGrid that
I have followed this tutorial here as mentioned exactly I now try to run
I have followed this tutorial to get my ListView populating data -- http://android.amberfog.com/?p=296 .
I have followed this great tutorial and I finally managed to implement a 3
I have followed this tutorial for building my chat application. When I try to
I have followed this tutorial which uses jQuery UI to generate Facebook tokens like:
I followed this tutorial http://www.tugberkugurlu.com/archive/api-key-authorization-through-query-string-in-asp-net-web-api-authorizationfilterattribute to create custom Authorization filter. I have CarController with
I've just followed this example from Wordpress and I have successfully added an extra
I have followed this tutorial: http://www.phpjabbers.com/how-to-make-a-php-calendar-php26-6.html#comments to make a very basic calendar. My aim
I have followed this tutorial, and made everything like the tutorial says... When I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.