CSharp examples for Microsoft.CodeAnalysis:Roslyn
Is type of string using Roslyn?
using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis; public class Main{ /// <summary> /// Is type of string? /// </summary> /// <param name="symbol"></param> /// <returns></returns> public static bool IsString(this ITypeSymbol symbol) {/*from w ww . j a v a 2s . com*/ if (symbol == null) return false; return symbol.MetadataName == "String"; } }