Dear anuradhapriyankara,
Its very easy, assign the spaces in first and last characters of richtextbox text as a string. F Y I, find the below code,
dim text as string = " " & richtxtbox.text.tostring() & " "
MessageBox.show(text.tostring())
Regards,
Bluesathish