String Manipulation
I've learned in my Visual Basic class at school that I complete detest
string manipulation. Also, as a classmate has so eloquently put it, "I hate my life." He says that every day. Of course, I say "Java sucks" at least twice each class. It's just our normal banter. What fun.
No one is commenting on my site. Do I need to start handing out gifts to those who post comments? I have some candy over here. Want some?
blnDone = True
J~
string manipulation. Also, as a classmate has so eloquently put it, "I hate my life." He says that every day. Of course, I say "Java sucks" at least twice each class. It's just our normal banter. What fun.
No one is commenting on my site. Do I need to start handing out gifts to those who post comments? I have some candy over here. Want some?
blnDone = True
J~
2 Comments:
At 7:26 PM, Anonymous said…
And just what is it you detest so much about string manipulation? It is "fun," "exciting," and "a great way to introduce security issues."
At 6:33 PM, Anonymous said…
Dim intVowelCount As Integer
'make the string all caps, to make the check case insensitive
strSentence = strSentence.ToUpper
'Loop until strSentence no characters left
Do Until strSentence.Length = 0
' if characters remain began if statment
' does strSentence Start with "A"?
If strSentence.StartsWith("A") = True Then
'yes, add to 1 counter then remove the character
intVowelCount = intVowelCount + 1
strSentence = strSentence.Remove(0, 1)
'if not, does strSentence Start with "E"?
ElseIf strSentence.StartsWith("E") = True Then
'yes, add to 1 counter then remove the character
intVowelCount = intVowelCount + 1
strSentence = strSentence.Remove(0, 1)
'if not, does strSentence Start with "I"?
ElseIf strSentence.StartsWith("I") = True Then
'yes, add to 1 counter then remove the character
intVowelCount = intVowelCount + 1
strSentence = strSentence.Remove(0, 1)
'if not, does strSentence Start with "O"?
ElseIf strSentence.StartsWith("O") = True Then
'yes, add to 1 counter then remove the character
intVowelCount = intVowelCount + 1
strSentence = strSentence.Remove(0, 1)
'if not, does strSentence Start with "U"?
ElseIf strSentence.StartsWith("U") = True Then
'yes, add to 1 counter then remove the character
intVowelCount = intVowelCount + 1
strSentence = strSentence.Remove(0, 1)
Else
'if not, Remove character
strSentence = strSentence.Remove(0, 1)
End If
Loop
Return Convert.ToString(intVowelCount)
End Function
Post a Comment
<< Home