C# Error CS1039 – Unterminated string literal

C# Error

CS1039 – Unterminated string literal

Reason for the Error & Solution

Unterminated string literal

The compiler detected an ill-formed literal.

Example

The following sample generates CS1039. To resolve the error, add the terminating quotation mark.

// CS1039.cs  
public class MyClass  
{  
    public static void Main()  
    {  
        string b = @"hello, world;   // CS1039  
    }  
}