Reverse Each Word of A String Instead of The String
Category:
String ManipulationType:
ModulesDifficulty:
IntermediateAuthor:
Fernando CaƱeteVersion Compatibility: Visual Basic 6
More information:
This function take a string of words and reverses each word in the string instead of the entire string. Syntax: StrReversed(). To test it, add the following controls to a form in a standard exe project, textBox, label and command button.
Example 1:
Input String = "My name is Albert McDonald."
Output String = "Ym eman si Trebla DlAnodcm."
Note: The words themselves should be in the same order as they were to begin with. If a word has upper case letters then those positions should still be upper case in the result set. Any non-alpha character will be retained as is.
Instructions: Copy the declarations and code below and paste directly into your VB project.
Declarations: