microsoft.visualbasic.Left(string,n) in VB 2005

  • Thread starter Thread starter AWW
  • Start date Start date
A

AWW

RichTextBox.Text = string & vbCR works but
if I extract a substring with microsoft.visualbasic.left
then vbCR stops working.
I can do F5 executes with/without the Left and the vbCr does/doesNot
work. Comment?
 
The following code shows a vbCR in both strings for me.

Dim s, s1, s2 As String

s = "this is an example string"

s1 = Microsoft.VisualBasic.Left(s, 5) & vbCr
s2 = s & vbCr

MessageBox.Show(String.Format("[{0}] [{1}]", s1, s2))
 
what if
s1 =s.substring(s,0,5) &vbcr
RichTextBox.Text = s1

or use vbcrlf?

No I have not tried


ModelBuilder said:
The following code shows a vbCR in both strings for me.

Dim s, s1, s2 As String

s = "this is an example string"

s1 = Microsoft.VisualBasic.Left(s, 5) & vbCr
s2 = s & vbCr

MessageBox.Show(String.Format("[{0}] [{1}]", s1, s2))



AWW said:
RichTextBox.Text = string & vbCR works but
if I extract a substring with microsoft.visualbasic.left
then vbCR stops working.
I can do F5 executes with/without the Left and the vbCr does/doesNot
work. Comment?
 
Thanks - yes it works. Made stupid prog mistake.

what if
s1 =s.substring(s,0,5) &vbcr
RichTextBox.Text = s1

or use vbcrlf?

No I have not tried


ModelBuilder said:
The following code shows a vbCR in both strings for me.

Dim s, s1, s2 As String

s = "this is an example string"

s1 = Microsoft.VisualBasic.Left(s, 5) & vbCr
s2 = s & vbCr

MessageBox.Show(String.Format("[{0}] [{1}]", s1, s2))



AWW said:
RichTextBox.Text = string & vbCR works but
if I extract a substring with microsoft.visualbasic.left
then vbCR stops working.
I can do F5 executes with/without the Left and the vbCr does/doesNot
work. Comment?
 
Back
Top