Question: I have input field where user provide his phone number, like that:

```
<label for="phone" class="first-col">Phone No.:</label>
<input type="text" id="phone" />
<span class="form-hint">Proper format "8 600 00 000"</span>

```

I need to make that when user typing number in following:

```
861234567

```

It automatically added spaces in following:

```
8 612 34 567

```

Any ideas how could I achieve It? Using *Java Script* or maybe with *CSS*? Or maybe there is way to achieve It via *HTML*? I've nothing found about that.

Answer: 
You'll need to handle the different types of `TypeSyntax`es. See here: <http://sourceroslyn.io/#Microsoft.CodeAnalysis.CSharp/Syntax/TypeSyntax.cs,29171ac4ad60a546,references>

What you see in the debugger is a `SimpleNameSyntax`, which does have a public `Identifier` property.

**Update**

```
var ns = objectCreationExpressionSyntax.Type as NameSyntax;
if (ns != null)
{
  return ns.Identifier.ToString();
}

var pts = objectCreationExpressionSyntax.Type as PredefinedTypeSyntax;
if (pts != null)
{
  return pts.Keyword.ToString();
}

... 

```

All other subtypes would need to be handed. Note that `ArrayType.ElementType` is also a `TypeSyntax`, so you would most probably need to make this method recursive.
You can get the identifier from the syntax's Type property:

```
foreach (var objectCreationExpressionSyntax in objectCreationExpressionSyntaxs)
{
    IdentifierNameSyntax ins = (IdentifierNameSyntax)objectCreationExpressionSyntax.Type;
    var id = ins.Identifier;
    Console.WriteLine(id.ValueText);
}

```