Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Chrtran in .NET
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01360482
Message ID:
01360550
Vues:
20
Thanks.

>Here are the StrTran methods from VFP Toolkit for .NET
>
>public static string StrTran(string cSearchIn, string cSearchFor)
>		{
>			//Create the StringBuilder
>			StringBuilder sb = new StringBuilder(cSearchIn);
>			
>			//Call the Replace() method of the StringBuilder
>			return sb.Replace(cSearchFor," ").ToString();
>		}
>
>
>
>public static string StrTran(string cSearchIn, string cSearchFor, string cReplaceWith)
>		{
>			//Create the StringBuilder
>			StringBuilder sb = new StringBuilder(cSearchIn);
>
>			//There is a bug in the replace method of the StringBuilder
>			sb.Replace(cSearchFor, cReplaceWith);
>
>			//Call the Replace() method of the StringBuilder and specify the string to replace with
>			return sb.Replace(cSearchFor, cReplaceWith).ToString();
>		}
>
>
>
>public static string StrTran(string cSearchIn, string cSearchFor, string cReplaceWith, int nStartoccurence, int nCount)
>		{
>			//Create the StringBuilder
>			StringBuilder sb = new StringBuilder(cSearchIn);
>
>			//There is a bug in the replace method of the StringBuilder
>			sb.Replace(cSearchFor, cReplaceWith);
>
>			//Call the Replace() method of the StringBuilder specifying the replace with string, occurence and count
>			return sb.Replace(cSearchFor, cReplaceWith, nStartoccurence, nCount).ToString();
>		}
>
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform