Publier
Profil
Docs
FAQ
Connexion
|
Inscription
Linux
Serveurs
Hardware
Python
Ajax / Javascript
C++
PHP
Infographie
Framework .NET
Edition :Manipulation de chaines
Modifier l'intitulé' :
<h3>Rechercher une sous-chaine dans une autre chaine</h3><p>Methode : <strong>String.Contains </strong></p><p>Exemple : </p><pre>string phrase = "The quick brown fox jumps over the lazy dog.";<br />bool result;<br /><br />result = phrase.Contains("brown fox"); <span class="comment">// result is true</span><br />result = phrase.Contains("lazy fox."); <span class="comment">// result is false</span></pre><p>Methode : <strong>StartWith </strong>et <strong>EndWith</strong></p><p>Exemple : </p><pre>string phrase = "The quick brown fox jumps over the lazy dog.";<br />bool result;<br /><br />result = phrase.StartsWith("The quick"); <span class="comment">// result is true</span><br />result = phrase.StartsWith("lazy dog."); <span class="comment">// result is false</span><br />result = phrase.EndsWith("lazy dog."); <span class="comment">// result is true</span><br />result = phrase.EndsWith("The quick"); <span class="comment">// result is false</span></pre><p> </p><p>Source: <a href="http://www.blackwasp.co.uk/CSharpStringTesting.aspx">http://www.blackwasp.co.uk/CSharpStringTesting.aspx</a></p>
-- Style --
-- Bloc de texte --
Paragraphe
Infos sur l'auteur
Texte préformaté
Titre de niveau 1
Titre de niveau 2
Titre de niveau 3
Titre de niveau 4
Titre de niveau 5
Titre de niveau 6
Type :
Solution
Ebauche d'article
Projet
Problème non résolu
Comparatif
Test