|
-
Jan 30th, 2002, 09:32 AM
#1
Thread Starter
Evil Genius
Left in Javascript ?
Hi all, can anyone please give me a regular expression or similar to grab the first character of a string please?
I.e. (Like VB's Left function) returning "A" from the string "Alex" ?
Thanks All !
-
Jan 30th, 2002, 09:52 AM
#2
PowerPoster
-
Jan 30th, 2002, 10:58 AM
#3
Frenzied Member
Try this.
Code:
myFirstChar = myString.match(/^./);
If that doesn't work, then find a book.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Jan 30th, 2002, 11:11 AM
#4
Thread Starter
Evil Genius
Thanks - big shout out to both of yous guys !
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
|