diff options
Diffstat (limited to 'src/mscorlib/src/System/Runtime/InteropServices/TCEAdapterGen/NameSpaceExtractor.cs')
-rw-r--r-- | src/mscorlib/src/System/Runtime/InteropServices/TCEAdapterGen/NameSpaceExtractor.cs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/TCEAdapterGen/NameSpaceExtractor.cs b/src/mscorlib/src/System/Runtime/InteropServices/TCEAdapterGen/NameSpaceExtractor.cs new file mode 100644 index 0000000000..8018ad4c66 --- /dev/null +++ b/src/mscorlib/src/System/Runtime/InteropServices/TCEAdapterGen/NameSpaceExtractor.cs @@ -0,0 +1,21 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Runtime.InteropServices.TCEAdapterGen { + + using System; + internal static class NameSpaceExtractor + { + private static char NameSpaceSeperator = '.'; + + public static String ExtractNameSpace(String FullyQualifiedTypeName) + { + int TypeNameStartPos = FullyQualifiedTypeName.LastIndexOf(NameSpaceSeperator); + if (TypeNameStartPos == -1) + return ""; + else + return FullyQualifiedTypeName.Substring(0, TypeNameStartPos); + } + } +} |