<!DOCTYPE html>
<html lang="en">

  <head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <title>NUnit.org</title>
  <meta name="description" content="NUnit is the most popular unit test framework for .NET.">

  <link rel="stylesheet" href="/css/main.css"">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
  <link rel="alternate" type="application/rss+xml" title="NUnit.org" href="/rss.xml"">
  <link rel="alternate" type="application/atom+xml" title="NUnit.org" href="/atom.xml" />
  <link rel="shortcut icon" href="/favicon.ico" />

  <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->
</head>

  <body>

    <nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container">
    <div class="navbar-header">
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="/">
            <div class="navbar-brand grow">
                <img src="/img/nunit.svg" />
            </div>
        </a>
    </div>
    <div id="navbar" class="collapse navbar-collapse">
        <ul class="nav navbar-nav">
            <li><a href="https://nunit.org/news/"><i class="fa fa-commenting-o"></i> News</a></li>
            <li><a href="https://nunit.org/download/"><i class="fa fa-download"></i> Download</a></li>
            <li><a href="https://docs.nunit.org"><i class="fa fa-book"></i> Documentation</a></li>
            <li><a href="https://nunit.org/contact/"><i class="fa fa-envelope-o"></i> Contact</a></li>
            <li><a href="https://twitter.com/nunit" target="_blank"><i class="fa fa-twitter"></i> Twitter</a></li>
            <li><a href="https://gitter.im/nunit/nunit" target="_blank"><i class="fa fa-comments-o"></i> Gitter</a></li>
            <li><a href="https://github.com/nunit" target="_blank"><i class="fa fa-github"></i> GitHub</a></li>
        </ul>
    </div><!--/.nav-collapse -->
    </div>
</nav>

  <div class="container">
    <div class="content help">
      <div class="notice">Legacy Documentation. View <a href="https://docs.nunit.org">NUnit 3 Documentation</a></div>
      <div id="help_content">

<h2>StringAssert (NUnit 2.2.3)</h2>
<p>The StringAssert class provides a number of methods that are useful
when examining string values.</p>

<div class="code" style="width: 36em">
<pre class="prettyprint">StringAssert.Contains( string expected, string actual );
StringAssert.Contains( string expected, string actual,
                string message );
StringAssert.Contains( string expected, string actual,
                string message, params object[] args );

StringAssert.StartsWith( string expected, string actual );
StringAssert.StartsWith( string expected, string actual,
                string message );
StringAssert.StartsWith( string expected, string actual,
                string message, params object[] args );

StringAssert.EndsWith( string expected, string actual );
StringAssert.EndsWith( string expected, string actual,
                string message );
StringAssert.EndsWith( string expected, string actual,
                string message, params object[] args );

StringAssert.AreEqualIgnoringCase( string expected, string actual );
StringAssert.AreEqualIgnoringCase( string expected, string actual,
                string message );
StringAssert.AreEqualIgnoringCase( string expected, string actual,
                string message params object[] args );

StringAssert.IsMatch( string regexPattern, string actual );
StringAssert.IsMatch( string regexPattern, string actual,
                string message );
StringAssert.IsMatch( string regexPattern, string actual,
                string message, params object[] args );</pre>
</div>

</div>

<!-- Submenu -->
<div id="subnav">
<ul>
<li><a href="docHome.html">NUnit 2.5.7</a></li>
<ul>
<li><a href="getStarted.html">Getting&nbsp;Started</a></li>
<li><a href="assertions.html">Assertions</a></li>
<ul>
<li><a href="equalityAsserts.html">Equality&nbsp;Asserts</a></li>
<li><a href="identityAsserts.html">Identity&nbsp;Asserts</a></li>
<li><a href="conditionAsserts.html">Condition&nbsp;Asserts</a></li>
<li><a href="comparisonAsserts.html">Comparison&nbsp;Asserts</a></li>
<li><a href="typeAsserts.html">Type&nbsp;Asserts</a></li>
<li><a href="exceptionAsserts.html">Exception&nbsp;Asserts</a></li>
<li><a href="utilityAsserts.html">Utility&nbsp;Methods</a></li>
<li id="current"><a href="stringAssert.html">String&nbsp;Assert</a></li>
<li><a href="collectionAssert.html">Collection&nbsp;Assert</a></li>
<li><a href="fileAssert.html">File&nbsp;Assert</a></li>
<li><a href="directoryAssert.html">Directory&nbsp;Assert</a></li>
</ul>
<li><a href="constraintModel.html">Constraints</a></li>
<li><a href="attributes.html">Attributes</a></li>
<li><a href="runningTests.html">Running&nbsp;Tests</a></li>
<li><a href="extensibility.html">Extensibility</a></li>
<li><a href="releaseNotes.html">Release&nbsp;Notes</a></li>
<li><a href="samples.html">Samples</a></li>
<li><a href="license.html">License</a></li>
</ul>
</ul>
</div>
<!-- End of Submenu -->



    </div>
  </div>

  <script src="/js/jquery.min.js"></script>
  <script src="/js/codeFuncs.js"></script>

    <footer class="footer">
  <div class="container">
    <div class="row text-muted">
      <div class="col-sm-8">
        NUnit 2 Documentation Copyright &copy; 2014, Charlie Poole. All rights reserved.
      </div>
      <div class="col-sm-4 text-right">
        Supported by the
        <a href="https://dotnetfoundation.org/">.NET Foundation</a>
      </div>
    </div>
  </div>
</footer>

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="/js/bootstrap.min.js"></script>

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-7904234-12', 'auto');
  ga('send', 'pageview');

</script>

  </body>
</html>
