Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Chrtran in .NET
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Environment versions
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01360482
Message ID:
01360550
Views:
21
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform