close panorama

String Plugin string.swf / string.js for Flash & HTML5
by Aldo Hoeben - fieldofview.com

Description

This plugin provides a number of string manipulation methods. These methods are meant to complement the builtin txtadd method to concatenate strings.

Download

string.swf  (plugin only)
string.js  (plugin only)

The string sources and examples are available as part of the fovplugins package

fovplugins.zip  (plugin, source code & examples)

Syntax / XML Usage Example

<plugin name="string" 
        url="string.swf" alturl="string.js" 
        keep="true" preload="true"
        />

Plugin Methods

txtlength(destVar, text)
Sets destVar to the length of 'text'.
txtchunk(destVar, text, start, length)
Sets destVar to the substring of 'text', starting from 'start' and 'length' characters long.
txtfind(destVar, text, find)
Sets destVar to the position of 'find' in 'text', or -1 if the text is not found.
txtreplace(destVar, text, find, replace, flags)
Sets destVar to a copy of 'text', replacing 'find' with 'replace'. The optional 'flags' argument can be used to set flags for the internal regular expression pattern (and defaults to ''gi' for a global, case-insensitive replace).
txttrim(destVar, text)
Sets destVar to 'text' without leading and trailing whitespace. If the second argument is omitted, the method alters the current contents of destVar instead.
txtupper(destVar, text)
Sets destVar to a uppercase version of 'text'. If the second argument is omitted, the method alters the current contents of destVar instead.
txtlower(destVar, text)
Sets destVar to a lowercase version of 'text'. If the second argument is omitted, the method alters the current contents of destVar instead.

Example

CLICK TO VIEW EXAMPLE

License

CC-BY-3.0 The plugin can be used free of charge, in commercial or non-commercial applications. The source code is available under a Creative Commons Attribution license.

In a nutshell, this means you are free to use the software and its source code in your projects. If you use the source code in another software project, you are required to add attribution to the author(s). You are encouraged to share the your source code under a similar fashion, but it is not a requirement.

If you use the plugins regularly, you may consider making a donation so I can afford to continue making these plugins and making them available.