예제 #1
0
        /// <summary>
        /// Gets if source stream valu starts with the specified value. Compare is case-insensitive.
        /// </summary>
        /// <param name="value">Value to check.</param>
        /// <returns>Returns true if source steam satrs with specified string.</returns>
        /// <exception cref="ArgumentNullException">Is raised when <b>value</b> is null.</exception>
        public bool StartsWith(string value)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }

            return(String2.StartsWith(m_Source.Substring(m_Offset), value, StringComparison2.InvariantCultureIgnoreCase));
        }
예제 #2
0
 /// <summary>
 /// Gets if source string starts with specified value.
 /// </summary>
 /// <param name="value">Start string value.</param>
 /// <param name="case_sensitive">Specifies if compare is case-sensitive.</param>
 /// <returns>Returns true if source string starts with specified value.</returns>
 public bool StartsWith(string value, bool case_sensitive)
 {
     if (case_sensitive)
     {
         return(String2.StartsWith(m_SourceString, value, StringComparison2.InvariantCulture));
     }
     else
     {
         return(String2.StartsWith(m_SourceString, value, StringComparison2.InvariantCultureIgnoreCase));
     }
 }