Question: State whether each of the following is true or false. If false, explain why. a) When strings are compared with ==, the result is true

State whether each of the following is true or false. If false, explain why.

a) When strings are compared with ==, the result is true if the strings contain the same values.

b) A string can be modified after it’s created.

c) StringBuilder method EnsureCapacity sets the StringBuilder instance’s length to the argument’s value.

d) Method Equals and the equality operator work the same for strings.

e) Method Trim removes all whitespace at the beginning and the end of a string.

f) It’s always better to use strings, rather than StringBuilders, because strings containing the same value will reference the same object.

g) string method ToUpper creates a new string with the first letter capitalized.

Step by Step Solution

3.46 Rating (169 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a True b False strings are immutable they cannot be modified after theyre created Str... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Visual C How Program Questions!