IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
To/From Code
-Collapse +Expand Cross Ref Guide
-Collapse +Expand Members-Only
Sign in to see member-only pages.
   ► KBTo/From GuidesJavaScriptCommands  Print This     

Cross Ref > Commands

By Mike Prestwood

JavaScript versus Delphi Prism: A side by side comparison between JavaScript and Delphi Prism.

 
Commands
 

Common commands (procedures and functions). A function returns a value. Optionally, it may also perform an action prior to returning a value. A procedure does not return a value or it returns void or null.

Left of String

[Other Languages] 
JavaScript:   substr

Above returns "Mike P".

SubStr(StartIndex, NumberOfCharacters)

Notice JavaScript is 0 based (the first character is character 0).�0 is start character, 6 is number�of characters).�

You can also use substring where both numbers are indexes:

SubString(StartIndex, EndIndex)

The following returns "re".

var sName;
sName = "Mike Prestwood";
sName = sName.substring(6, 8);
document.write(sName);
Syntax Example:
var sName;
sName = "Mike Prestwood";
sName = sName.substr(0, 6);
document.write("Hello " + sName);
Delphi Prism:   Substring
Syntax Example:
MessageBox.Show("Prestwood".Substring(0, 3));




Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


©1995-2024 Prestwood IT Solutions.   [Security & Privacy]