Tab character in a string

Results 1 to 2 of 2

Thread: Tab character in a string

  1. #1
    Join Date
    Dec 1969

    Default Tab character in a string

    Hello,<BR><BR>I am creating a mailmessage in a code behind page with System.Web.Mail.MailMessage. I create a String for the body of the message. I wanted to have a table in the body of the email, and have been trying to use a tab character to do this; but everything i have used to insert a tab into my string only seems to insert one blank space. I have tried to use vbTab, Chr(9), Chr(&H9), and ControlChars.Tab. All of these only inser one black space into my string and do not tab. Here is a snippet of my code:<BR><BR> bodystr += tb1.Text + vbTab + vbTab<BR> bodystr += tb2.Text + vbTab + vbTab<BR> bodystr += tb3.Text + vbCrLf<BR><BR>tb1, tb2, and tb3 are textboxes, and i am using in an page. any information you have may be helpful thank you in advance!

  2. #2
    Join Date
    Dec 1969

    Default vbTab should work...

    Though you should be using & and &= instead of + and += for string concatenation. <BR><BR>If you are sending HTML EMail, though, a TAB and a space are exactly equivalent. HTML displays each as a single space on the screen.<BR><BR>Have you made sure that you are sending EMail as *TEXT* and NOT as HTML?<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts