Question add a letter to the end of an sentence in string

Yami-Sama

New member
Joined
Jul 15, 2008
Messages
2
Programming Experience
Beginner
right now im writing a program how to encode and decode
english sentences.

im stuck in step in the encoding

here how it is:
1- the user will inter into the text box an english sentence.
2- if the number of chrachters of the sentence is odd the program
well add to the end of the sentence a chrachter to make it even.
 
You could do something like and just replace the space with what ever character you want to put on the end.

VB.NET:
textbox1.Text = IIf((textbox1.Text.Length Mod 2) = 0,textbox1.Text,String.Format("{0} ", textbox1.Text))
 
Last edited:
Back
Top