Proceed to WirelessDevNet Home Page
Publications, e-books, and more! Community Tutorials Store Downloads, tools, & Freebies! IT Career Center News Home
newnav.gif

Newsletters
EMail Address:



   Content
  - Articles
  - Columns
  - Training
  - Library
  - Glossary
 
   Career Center
  - Career Center Home
  - View Jobs
  - Post A Job
  - Resumes/CVs
  - Resource Center
 
   Marketplace
  - Marketplace Home
  - Software Products
  - Wireless Market Data
  - Technical Books
 
   News
  - Daily News
  - Submit News
  - Events Calendar
  - Unsubscribe
  - Delivery Options
 
   Community
  - Discussion Boards
  - Mailing List
  - Mailing List Archives
 
   About Us
  - About WirelessDevNet
  - Wireless Source Disks
  - Partners
  - About MindSites Group
  - Advertising Information
 
WMLScript Reference WMLScript Reference

WMLScript > String > insertAt()

insertAt() - The insertAt Function

Usage:  
insertAt(string, element, index, separator)
Description:  Returns a new string with the element and the corresponding separator (if existing) inserted at the specified index of the original string. If the index is less than 0 then 0 is used as the index. If the index is larger than the number of elements then the element is appended at the end of the string. If the string is empty, the function returns a new empty string with the given element.

If the index is of type floating-poing, Float.int() is first used to calculate the actual index value.


Example:
var a = "B C; E";
var s = " ";
var b = String.insertAt(a, "A", 0, s);     // b = "A B C; E"
var c = String.insertAt(a, "X", 3, s);     // c = "B C; E X"
var d = String.insertAt(a, "D", 1, ";");   // d = "B C;D; E"
var e = String.insertAt(a, "F", 5, ";");   // e = "B C; E;F"




Bookmark this page
Sponsors

Search

Eliminate irrelevant hits with our industry-specific search engine!









Wireless Developer Network - A MindSites Group Trade Community
Copyright© 2000-2010 MindSites Group / Privacy Policy
Send Comments to:
feedback@wirelessdevnet.com