Any way to parse a string?

Does anyone know the command to delete everything after an x amount of characters on a string? For examp…

Sunday, 14th December 2003 2:10am asdadasdasd as da d asd oiajskdj lkasjdk

Thanks :smirk:

that is true :smiley:

lol… I totally forgot about String.substring :smiley:

hah… way cool my dudee’s :slight_smile:

may i ask why you use colons? (":" not the body organ)

*Originally posted by norie *
**ahh, i see. Kinda caught me off guard. I thought if there were to do that i’d be something like this:

String m_strVar1;

Also, why type i as a number? or you just trying to maintain good coding habits? **

It’s funny that you should mention that actually… nobody really knows why the developers of ECMAScript chose the : syntax instead of the C++/Java type syntax.

I dunno why I typed i as a number… I just use Strict Typing when I can I guess :wink:

is strict typing also relevant in JS, because JS is also ECMA

I think it will be in the next version of JavaScript… but atm it’s not supported.

I use Mozilla, and it comes with a little JavaScript console that you can test snippets with. It gave me a syntax error when I tried:

var x:Number = 5;
//this worked fine:
var x = 5;

So I don’t think it is supported :slight_smile: