Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Comparing Data Row column values and string values
Message
 
 
À
10/07/2013 11:49:17
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01578028
Message ID:
01578113
Vues:
34
>>BTW, I re-checked that method (you helped with it a while ago) and it doesn't trim
>
>
>Then I would make it trim
>>
>>
>>/*========================================================================================
>>       *                Dictionary<String, String> ToSQML
>>       *=======================================================================================*/
>>      /// <summary>
>>      /// Populates a <string, string> dictionary using a SQML string.    
>>      /// </summary>
>>      /// <param name="tDictionary"></param>
>>      /// <param name="tcSQML"></param>
>>      public static void PopulateFromSQML(this Dictionary<String, String> tDictionary, String tcSQML)
>>      {
>>         tDictionary.Clear();
>>
>>         String pattern = @"<(?<field>[^/>]+)>(?<data>.*)</\k<field>>";
>>
>>         MatchCollection matches = Regex.Matches(tcSQML, pattern, RegexOptions.Singleline);
>>         foreach (Match m in matches)
>>         {
>>            if (!tDictionary.ContainsKey(m.Groups["field"].ToString()))
>>               tDictionary.Add(m.Groups["field"].ToString(), m.Groups["data"].ToString());
>>         }
>>      }
>>
>>So, we can keep trim.

Ok, I'll add this, but that's not the main question.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform