# ExpressionCs class

Namespace: [Grasshopper2.Expressions](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.expressions.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public static class ExpressionCs
```

Utility class for creating valid C# source and assemblies from expression syntax.

## Methods

- [CSharpifyCode](https://developer.rhino3d.com/api/gh2/type/grasshopper2.expressions.expressioncs/csharpifycode.md): (static) Convert a string into a valid C# string.
- [CSharpifySyntax](https://developer.rhino3d.com/api/gh2/type/grasshopper2.expressions.expressioncs/csharpifysyntax.md): (static) Process an expression and turn it into compilable CSharp code. This method will remove all comments from the code string, it will inject missing return statements and terminal semi-colons, exotic operators and constants. Undeclared variables will be replaced by C#-compliant method invokes.
- [TryCSharpifyAsBestAsPossible](https://developer.rhino3d.com/api/gh2/type/grasshopper2.expressions.expressioncs/trycsharpifyasbestaspossible.md): (static) Try and create the source code for an expression.
