Question: I want to test if the `StringBuilder` is empty but there is no `IsEmpty` method or property.

How does one determine this?

Answer: 
If you look at the [documentation of StringBuilder](https://msdn.microsoft.com/en-us/library/system.text.stringbuilder(v=vs.110).aspx) it has only 4 properties. One of them is `Length`.

> 
> The length of a StringBuilder object is defined by its number of Char objects.
> 
> 
> 

You can use the [Length](https://msdn.microsoft.com/en-us/library/system.text.stringbuilder.length(v=vs.110).aspx) property:

> 
> Gets or sets the length of the current StringBuilder object.
> 
> 
> 

```
StringBuilder sb = new StringBuilder();

if (sb.Length != 0)
{
    // you have found some difference
}

```

Another possibility would be to treat it as a string by using the [String.IsNullOrEmpty](https://msdn.microsoft.com/en-us/library/system.string.isnullorempty(v=vs.110).aspx) method and condense the builder to a string using the `ToString` method. You can even grab the resulting string and assign it to a variable which you would use if you have found some differences:

```
string difference = ""; 

if (!String.IsNullOrEmpty(difference = sb.ToString()))
{
    Console.WriteLine(difference);      
}

```
Use this, it will work:

```
StringBuilder stringbuilder = new StringBuilder();
if(string.isnullorempty(Convert.toString(stringbuilder)))

```