Example #1
0
        /// <summary>
        /// Returns a value stating whether the current <see cref="Utf8String"/> instance contains
        /// the specified <see cref="Rune"/>. The specified comparison is used.
        /// </summary>
        public bool Contains(Rune value, StringComparison comparison)
        {
            // TODO_UTF8STRING: Optimize me to avoid allocations.

#if (!NETSTANDARD2_0 && !NETFRAMEWORK)
            return(ToString().Contains(value.ToString(), comparison));
#else
            return(ToString().IndexOf(value.ToString(), comparison) >= 0);
#endif
        }
Example #2
0
        /// <summary>
        /// Returns a value stating whether the current <see cref="Utf8String"/> instance begins with
        /// the specified <see cref="Rune"/>. The specified comparison is used.
        /// </summary>
        public bool StartsWith(Rune value, StringComparison comparison)
        {
            // TODO_UTF8STRING: Optimize me to avoid allocations.

            return(ToString().StartsWith(value.ToString(), comparison));
        }
        /// <summary>
        /// Returns a value stating whether the current <see cref="Utf8String"/> instance contains
        /// the specified <see cref="Rune"/>. The specified comparison is used.
        /// </summary>
        public bool Contains(Rune value, StringComparison comparison)
        {
            // TODO_UTF8STRING: Optimize me to avoid allocations.

            return(this.ToString().Contains(value.ToString(), comparison));
        }