Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions snippets/csharp/System.Text/StringBuilder/Capacity/cap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Ensure sb1 has a capacity of at least 50 characters.
b1) sb1.Length = 3, sb1.Capacity = 50
b2) sb2.Length = 3, sb2.Capacity = 16
b3) sb1.ToString() = "abc", sb2.ToString() = "abc"
b4) sb1 equals sb2: False
b4) sb1 equals sb2: True (False on .NET Framework)

Set the length of sb1 to zero.
Set the capacity of sb2 to 51 characters.
Expand All @@ -68,4 +68,4 @@ Set the capacity of sb2 to 51 characters.
c3) sb1.ToString() = "", sb2.ToString() = "abc"
c4) sb1 equals sb2: False
*/
//</snippet1>
//</snippet1>
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ printfn $"c4) sb1 equals sb2: {sb1.Equals sb2}"
// b1) sb1.Length = 3, sb1.Capacity = 50
// b2) sb2.Length = 3, sb2.Capacity = 16
// b3) sb1.ToString() = "abc", sb2.ToString() = "abc"
// b4) sb1 equals sb2: False
// b4) sb1 equals sb2: True (False on .NET Framework)
//
// Set the length of sb1 to zero.
// Set the capacity of sb2 to 51 characters.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
' This example demonstrates StringBuilder.EnsureCapacity
' StringBuilder.Capacity
' StringBuilder.Length
Expand Down Expand Up @@ -53,7 +53,7 @@
' b1) sb1.Length = 3, sb1.Capacity = 50
' b2) sb2.Length = 3, sb2.Capacity = 16
' b3) sb1.ToString() = "abc", sb2.ToString() = "abc"
' b4) sb1 equals sb2: False
' b4) sb1 equals sb2: True (False on .NET Framework)
'
' Set the length of sb1 to zero.
' Set the capacity of sb2 to 51 characters.
Expand Down
Loading