Обычные макросы => C# макросы
Please read the Terms of Use for Materials on ZennoLab
This page has been translated automatically
We want to provide you with the latest help content in your language as soon as possible. This page has been translated automatically and may contain grammatical errors or inaccuracies. We want this content to be useful to you. Please let us know at the bottom of this page if this information was helpful.
View the original article in Russian: Обычные макросы => C# макросы
Work with text
Let's say the yourText variable stores your text.
Regular macro | C # macro |
---|---|
String.SubString | yourText.Substring(…) |
var yourText = "For the second time in three years...";
return yourText.Substring(3,10);
String.Replace | yourText.Replace(…) |
var yourText = "For the second time in three years...";
return yourText.Replace("For","*");
String.Insert | yourText.Insert(…) |
var yourText = "For the second time in three years...";
return yourText.Insert(0, "Hi there.");
String.ToUpper | yourText.ToUpper() |
String.ToLower | yourText.ToLower() |
String.Split | Macros.TextProcessing.Split(…) |
String.SplitCount | yourText.Split(…).Length |
String.RemoveDuplicates | Macros.TextProcessing.RemoveDuplicates(…) |
String.Enter | System.Environment.NewLine |
String.Spintax | Macros.TextProcessing.Spintax(…) |
Profile and personal data
Regular macro | C # macro |
---|---|
Profile.Age | project.Profile.Age |
… | |
Profile.Login | project.Profile.Login |
… | |
Profile.ZipCode | project.Profile.ZipCode |
Random variables
Regular macro | C # macro |
---|---|
Random.Int | Random.Next(…) |
Random.Double | Random.NextDouble() |
Files and directories
Regular macro | C # macro |
---|---|
File.GetString | Macros.FileSystem.FileGetLine() |
File.GetBlock | Macros.FileSystem.FileGetBlock() |
File.AppendString | Macros.FileSystem.FileAppendString() |
File.CountOfStrings | Macros.FileSystem.FileCountOfLines() |
File.Copy | Macros.FileSystem.FileCopy() |
Directory.CountOfFiles | Macros.FileSystem.DirectoryCountOfFiles() |
Directory.RandomFile | Macros.FileSystem.DirectoryRandomFile() |
Directory.DeleteFileByMask | Macros.FileSystem.DirectoryDeleteFileByMask() |
Directory.DeleteFile | Macros.FileSystem.DirectoryDeleteFile() |
Directory.SelfFile | Macros.FileSystem.DirectoryDeleteDirectory() |
Regular expressions
Counters
Regular macro | C # macro |
---|---|
Counter.Set | var counter = 0; |
Counter.Add | counter++; |
Counter.Multiple | counter = counter*2; |
Counter.Get | return counter; |
In order to work with project variables in the code, you must use the following construction:
Global Variables
To work with global variables in the code, its value is taken using the following construction:
Operations with global variables are similar to operations with counters.