Unformatted text preview: how to remove the last hyphen. 5. Write a function that counts the number of punctuation characters in a string. To determine if a character in a string is punctuation, you can do this: Dim s as String = “mr. tickle” If Char.IsPunctuation(s(0)) Then 'False – “m” is not punctuation If Char.IsPunctuation(s(2)) Then 'True – “.” is punctuation 6. Write a function that determines if a string is all upper case. To determine if a character in a string is upper case, you can use the Char.IsUpper() function, which works much the same as the Char.IsPunctuation() function above. 7. Write a function that puts a string into alternating upper and lower case letters. For example “fuDGe” would become “FuDgE” and “ms. world dictator” would become “Ms. WoRlD dIcTaToR”....
View Full Document
This note was uploaded on 10/12/2011 for the course CMPT 110 taught by Professor Andrew during the Fall '10 term at Simon Fraser.
- Fall '10