-
Dec 14th, 2003, 02:14 AM
#1
JS: functions similar to PHP's "substr()" and "strlen()" [nevermind]
I'm not really into JS at all, but I'm working on something and since I have no idea of the JS functions or where to find an index of them, I decided I'd ask here. I'm looking for a function similar to PHP's substr() function. If you don't know what the substr() function does; I'll try to explain.
substr()
Syntax: substr(str string, int start pos [, int length]);
Purpose: Returns part of string specified by the start pos and length parameters.
Usage:
PHP Code:
<?
$var = "12345";
echo substr($var, 1, 2);
?>
This will print: 23
I'm also looking for a function similar to PHP's strlen() function, which just returns the number of characters in a string.
Any help is appreciated.
edit: nevermind, found what I needed.
Last edited by kows; Dec 14th, 2003 at 03:21 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|