Beispiel #1
0
 public IEnumerator <ITask> SplitHandler(Split split)
 {
     split.ResponsePort.Post(
         SplitResponse.FromRequest(split.Body)
         );
     yield break;
 }
        /// <summary>
        /// FromRequest - Performs the Split function
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public static SplitResponse FromRequest(SplitRequest request)
        {
            SplitResponse response = new SplitResponse();

#if URT_MINCLR
            response._strings = request.String.Split(request.Separator[0]);
#else
            if (request.Count > 0)
            {
                response._strings = request.String.Split(
                    new string[] { request.Separator },
                    request.Count,
                    StringSplitOptions.None
                    );
            }
            else
            {
                response._strings = request.String.Split(
                    new string[] { request.Separator },
                    StringSplitOptions.None
                    );
            }
#endif
            return(response);
        }