예제 #1
0
 public static StringInfo ReplaceByPosition(this StringInfo str, string replaceBy, int offset, int count)
 {
     if (replaceBy != EMPTY)
     {
         return(str.RemoveByTextElements(offset, count).InsertByTextElements(offset, replaceBy));
     }
     else
     {
         return(str.RemoveByTextElements(offset, count));
     }
 }
예제 #2
0
        public static StringInfo ReplaceByPosition(this StringInfo str, string replaceBy, int offset, int count)
        {
            if (!str.String.Contains(replaceBy))
            {
                return(str);
            }

            return(str.RemoveByTextElements(offset, count).InsertByTextElements(offset, replaceBy));
        }