Navigation:  Macroses >

Strings processing

Previous pageReturn to chapter overviewNext page
Show/Hide Hidden Text

 

Substring

Pass a string to the macro and specify which part you need entering the symbol number in the input string and the substring length. If the number of symbols is not specified the substring will be taken up to the end.

 

Example 1

 

Input string

0123456789

Number of initial symbol

4

Number of characters

Not specified

 

Macro

{-String.SubString-|-0123456789-|-4-}

 

Result

456789

 

Example 2

 

Input string

0123456789

Number of initial symbol

0

Number of characters

5

 

Macro

{-String.SubString-|-0123456789-|-0-|-5-}

 

Result

01234 

 

Replacement

Pass a string, where the replacement is needed, to the macro, indicate what symbols must be replaced and what must be inserted instead of them.

 

Example

 

Input string

<table bgcolor=#dcdcdc>

That is replaced

dcdcdc

At that replaced

cccccc

 

Macro

{-String.Replace-|-<table bgcolor=#dcdcdc>-|-dcdcdc-|-cccccc-}

 

Result

<table bgcolor=#cccccc> 

 

Insert

Pass a string, where it is needed to insert the substring, to the macro specifying the symbol number that the insertion starts with and indicating the substring that must be inserted.

 

Example

 

Input string

abcfgh

Number of characters

3

Substitute the substring

DE

 

Macro

{-String.Insert-|-abcfgh-|-3-|-DE-}

 

Result

abcDEfgh 

 

To uppercase

Pass a string, where some symbols must be converted to the uppercase, to the macro specifying the symbol number. It is possible to indicate the symbols range (0-2,4 or 5-end) or leave it as it is, in this case all the string will be converted.

 

Example 1

 

Input string

test string

Number of characters

0,5,7-9

 

Macro

{-String.ToUpper-|-test string-|-0,5,7-9-}

 

Result

Test StRINg

 

Example 2

 

Input string

test string

Number of characters

Not specified

 

Macro

{-String.ToUpper-|-test string-}

 

Result

TEST STRING 

 

To lower case

The operation is similar to the conversion to the uppercase. Pass a string, where some symbols must be converted to the lowercase, to the macro specifying the symbol number. It is possible to indicate the symbols range (0-2,4 or 5-end) or leave it as it is, in this case all the string will be converted.

 

String split

Pass a string, written through a divider (for ex: login:password), to the macro . Specify the division symbol and the number of the required substring.

 

Example

 

Input string

username:pass:login:password

Separator character

:

Number of substrings

3

 

Macro

{-String.Split-|-login:password:login:password-|-:-|-3-}

 

Result

password

 

Number of blocks after the separation line

Give the macros a row, recorded through a separator, and specify the separator character.

 

Example

 

Input string

username:pass:login:password

Separator character

:

 

Macro

{-String.SplitCount-|-username:pass:login:password-|-:-}

 

Result

4

 

Remove duplicates

Pass a string, written through a divider, to the macro  where it is needed to delete duplicate data and specify the division symbol.

 

Example

 

Input string

111|2222|111|33|55555

Separator character

|

 

Macro

{-String.RemoveDuplicates-|-111|2222|111|33|55555-|-|-}

 

Result

111|2222|33|55555

 

String transliteration

Pass a string, where Russian letters must be translated into English, to the macro. You can edit the replacement dictionary, that is located in  Settings\translit.csv, yourself.

 

Example

 

Input string

Привет, как дела

 

Macro

{-String.ToTranslit-|-Привет, как дела-}

 

Result

Privet, kak dela 

 

Insert Enter

This macro can be useful, for example, in this situation:

 

Example

 

Input string

text\r\ntext\r\ntext

That is replaced

\r\n\r\n

At that replaced

{-String.Enter-}

 

Macro

{-String.Replace-|-text\r\ntext\r\ntext-|-\r\n-|-{-String.Enter-}-}

 

Result

text

text

text 

 

Get symbol according to its code

This macro allows you to receive any symbol specifying its code.

 

Example

 

Macro

{-String.CodeToChar-|-169-}

 

Result

© 

 

Spintax

Pass a string of {111|222|333} type, where it is necessary to specify text variants instead of numbers to the macro. One of the variants will be the result of this macro execution.

 

Example

 

Input string

{Hi|Hello|Hey}

 

Макрос

{-String.Spintax-|-{Hi|Hello|Hey}-}

 

Result

Hello