Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Occurs in C#
Message
De
27/02/2013 09:31:30
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01566946
Message ID:
01567033
Vues:
28
>>I have updated my answer
>
>I have a compiler warning (green underline) under this test
>
>
> public static Int32 Occurs(this String source, char pattern)
>      {
>         if (null==pattern)
>            return 0;
>         return source.Split(pattern).Length - 1;
>      }
>
>It is saying that value of type int never equals null.
>
>So, do I really need this test here for char?


No - I only mentioned for pattern = string
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform