Artemis.Engine.Utilities.UriTree.UriUtilities.GetFirstPart C# (CSharp) Method

GetFirstPart() public static method

Get the first part of a Uri name. Example: GetFirstPart("a.b.c") returns "a"
public static GetFirstPart ( string name ) : string
name string
return string
        public static string GetFirstPart(string name)
        {
            return new String(name.TakeWhile(c => c != URI_SEPARATOR).ToArray());
        }

Usage Example

コード例 #1
0
        public U GetObservedNode(Dictionary <string, U> observedNodes, string name)
        {
            if (name.Contains(UriUtilities.URI_SEPARATOR))
            {
                var firstPart   = UriUtilities.GetFirstPart(name);
                var allButFirst = UriUtilities.AllButFirstPart(name);

                return(observedNodes[firstPart].GetSubnode(allButFirst));
            }
            return(observedNodes[name]);
        }