First letter: Mid(stringName, 1,1)
Last letter: Mid(stringName, stringName.Leng th, 1)
explanation:
- stringName is obvious what that stands for.
- the second parameter is the position of the first character of the substring you want to create in the original string.
- the third parameter is the length of the substring you want to create.
Last edited by Killer42; Nov 13 '07, 02:39 AM.
Reason: You need to practice spelling "lenght" :)
Mohan was pointing out that in demonstrating the two operations (first character, last character) we were both overwriting the value in sOutput. The result is that you would only actually get the last character.
I was aware of that, but didn't worry about it. We weren't trying to provide finished code, just demonstrating some concepts.
Mohan was pointing out that in demonstrating the two operations (first character, last character) we were both overwriting the value in sOutput. The result is that you would only actually get the last character.
I was aware of that, but didn't worry about it. We weren't trying to provide finished code, just demonstrating some concepts.
Comment