Strings Flashcards
Given a string, how to determine if its permutation could form a palindrome ?
If a string with an even length is a palindrome, every character in the string must always occur an even number of times. If the string with an odd length is a palindrome, every character except one of the characters must always occur an even number of times
What function determines that character is a letter or digit?
Char.IsLetterOrDigit(‘c’);
What character function converts the character to lower case?
Char.ToLower(‘c’);
How to reverse the string in C#?
char[] charArray=str.ToCharArray(); Array.Reverse(charArray); string reversedString=new string(charArray);
Given integer, how to get its corresponding character?
(char)number
What is the string Builder.Remove signature looks like?
Remove (int startIndex, int length);
Can we use foreach with string builder?
foreach statement cannot operate on variables of type ‘StringBuilder’ because ‘StringBuilder’ does not contain a public instance definition for ‘GetEnumerator’