Strings and text Flashcards

1
Q

Strings and text

A

In C#, all strings are immutable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Inefficient built-in string APIs

A
String.StartsWith, default culture	137
String.EndsWith, default culture	542
String.StartsWith, ordinal	115
String.EndsWith, ordinal	34
Custom StartsWith replacement	4.5
Custom EndsWith replacement	4.5
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Regular Expressions

A

While Regular Expressions are a powerful way to match and manipulate strings, they can be extremely performance-intensive. Further, due to the C# library’s implementation of Regular Expressions, even simple boolean IsMatch queries allocate large transient datastructures “under the hood.” This transient managed memory churn should be deemed unacceptable, except during initialization.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

XML, JSON and other long-form text parsing

A

Option 1: Parse at build time
Option 2: Split and lazy load
Option 3: Threads

How well did you know this?
1
Not at all
2
3
4
5
Perfectly