DoesNotEndWith
public static bool DoesNotEndWith(this string input, string pattern) { return string.IsNullOrEmpty(pattern) || input.IsNullOrEmptyOrWhiteSpace() || !input.EndsWith(pattern, StringComparison.CurrentCulture); }Example:
Assert.IsTrue("Test".DoesNotEndWith('?'));
Description
It returns true if string does not end with the character otherwise returns false. If you pass null or empty string, false will be returned.
Details
- Author: Omkar Panhalkar
- Submitted on: 7-5-2012 03:54:40
- Language: C#
- Type: System.String
- Views: 2653
Double click on the code to select all.