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:
01360510
Views:
23
This message has been marked as a message which has helped to the initial question of the thread.
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();
		}
Semper ubi sub ubi.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform