You are not logged in! Log in or Register

StringFormatter

Description

A StringFormatter block enables some advanced string formatting abilities.

Attributes

  • AddToBack [string]: The string to add to the back of the input string.
  • AddToFront [string]: The string to add to the front of the input string.
  • Name [string]: The name of the block.
  • Replace [string]: (in combination with 'ReplaceWith') a string to replace.
  • ReplaceWith [string]: (in combination with 'Replace') the string to the replace the 'Replace' string with.
  • String [string, readonly]: The last string output.
  • StringChanged [event]: Event raised when the string has changed.
  • StringInput [string input]: Connect any block that outputs a string.
  • StripBack [integer]: The number of characters to remove from the back of the input string.
  • StripFront [integer]: The number of characters to remove from the front of the input string.

Output connectors

  • String: the formatted string.

Remarks

The order of formatting is as follows:

  • the "StripFront" front characters are stripped
  • the "StripBack" back characters are stripped
  • the "Replace" string is replaced with the "ReplaceWith" string
  • the "AddToFront" string is added
  • the "AddToBack" string is added

Example

 1 <StringFormatter Name="formatter" StringInput="textboxname" 
 2 	AddToFront="Hello " StripBack="2"/>
 3 
 4 <VisualPage>
 5   <VisualContent>
 6     <VisualText Text="What is your name?"/>
 7     <VisualTextBox Name="textboxname"/>
 8     <VisualText Input="formatter"/>
 9   </VisualContent>
10 </VisualPage>                  
Example image

User comments

Nothing comments yet. Be the first!

Leave a comment

You need to be logged in to post a comment.