# Any way to parse a string?

**URL:** <https://forum.kirupa.com/t/any-way-to-parse-a-string/96823>\
**Category:** Uncategorized\
**Created:** [December 14, 2003, 7:10am UTC](https://forum.kirupa.com/t/any-way-to-parse-a-string/96823 "2003-12-14T07:10:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dudeman](https://avatars.discourse-cdn.com/v4/letter/d/35a633/32.png) [@dudeman](https://forum.kirupa.com/u/dudeman)\
**Post date:** [December 14, 2003, 7:10am UTC](https://forum.kirupa.com/t/any-way-to-parse-a-string/96823/1 "2003-12-14T07:10:44Z")

</div>

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 😏

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 14, 2003, 6:39pm UTC](https://forum.kirupa.com/t/any-way-to-parse-a-string/96823/2 "2003-12-14T18:39:21Z")

</div>

that is true 😃

lol… I totally forgot about String.substring 😃

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 15, 2003, 2:06am UTC](https://forum.kirupa.com/t/any-way-to-parse-a-string/96823/3 "2003-12-15T02:06:22Z")

</div>

hah… way cool my dudee’s 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 15, 2003, 2:21am UTC](https://forum.kirupa.com/t/any-way-to-parse-a-string/96823/4 "2003-12-15T02:21:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 15, 2003, 7:54pm UTC](https://forum.kirupa.com/t/any-way-to-parse-a-string/96823/5 "2003-12-15T19:54:09Z")

</div>

> \*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:

```auto

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 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 15, 2003, 8:22pm UTC](https://forum.kirupa.com/t/any-way-to-parse-a-string/96823/6 "2003-12-15T20:22:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 15, 2003, 8:29pm UTC](https://forum.kirupa.com/t/any-way-to-parse-a-string/96823/7 "2003-12-15T20:29:37Z")

</div>

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:

```auto

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

```

So I don’t think it is supported 🙂
