String cleanup

Atos
07-20-2003, 02:44 PM
Hi,
How do i strip the first 11 characters in a rich text box, removing any carrige returns if present?

i have text in rich text box and would like to take the first x amount of characters and drop them in another text box...suggesting a title of the content...

when i do that, i get these squares representing vbCrLf and i can not use that string for filename.

Can anyone suggest how i should handle this?

this is what i am working with:

NoteTitleBox.Text = Trim(Mid(NoteTextBox.Text, 1, 11))

the notetextbox is a rich text box control


Thanx in advance.

Csharp
07-20-2003, 03:17 PM
Private Sub Command1_Click()
RichTextBox1.Text = Replace(RichTextBox1.Text, Left(RichTextBox1.Text, 11), "")
End Sub

or better still ( if you dont have the replace function that is )

Private Sub Command1_Click()

With RichTextBox1
.SelStart = 0
.SelLength = 11
.SelText = ""
End With

End Sub

Atos
07-20-2003, 03:28 PM
thanx again Dynamic!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum