String manipulations

*Originally posted by sbeener *
**and in the string is like an array debate, i’m firmly in the “not the same thing” camp. **
Ouuhh… That one hurt… Let me explain then: I said that I find arrays [SIZE=1]a bit[/SIZE] similar to strings [SIZE=1]sometimes[/SIZE] because of the .length thing, and because elements of a String can be accessed quite similarly to Arrays elements (in very simple cases). Of course I never said they were the same, but the way I see it, you could use Arrays instead of Strings in most cases (and in C, C++ and Java, Strings are in fact arrays of char if I’m ot mistaken so I don’t how Flash works, but it must be similar).

pom :stuck_out_tongue:

roflmao… poor Pom…

I knew what you meant anyway… don’t listen to us peanut gallery types. We love you Pom, and you go on thinking that strings and array are whatever they need to be to you, to let you grasp them. I often use associations for things to help me remember how to use them. Rarely do they make sense to anyone other than myself.

Haha, word association is about 95% of the method I have to use to memorize things. No one can understand it, but it works good for me. You could say the word apple and I will remember I have to return a rented movie, I will remember that because there was an apple in the movie or something. Very odd, I don’t even understand it, my brain just works it out on its own.

This thread has been very educational to me. I stood back and learned. I still need to learn more of the basics though. Whenever I seem to run a search for tutorials on strings I get all these entries for learning RegEXP for MX. Is this what I need to know?

Thanks Upu :slight_smile:

And Lost, RegEXP are useful, so you should definitely learn that, but if you want to learn the Strings methods, open the AS dictionary and just try them…

pom :asian:

Sounds fun fun fun, I guess I will do that friday or saturday. I won’t be home tomorrow so I can’t try it then.

Time to find that RegEXP site again. It looked very useful, it gave a list of things and described what each did.

can you guys explain a little bit of what ‘RegEXP’ is?.. and is it something that’s new with MX, because I’ve never heard of it.

http://www.jurjans.lv/flash/RegExp.html

There is the link I found on it. It may be useful. It says it is for Flash 5 and MX david.

RegExp = regular expressions.

very powerful method of pattern matching in strings.

ily - no hard feelings! consider … you can have an array of strings, but can you have an string of arrays?

Ahaha! I was waiting for your answer Supra :stuck_out_tongue:
I agree with you, their are not the same, but what’s a String? An array of char. So let’s settle with this: Strings are a very particular kind of arrays… Or do you disagree?

pom :slight_smile:

Ah ha: Supra, this:
‘you can have an array of strings, but can you have an string of arrays?’
is EXACTLY the words i was thinking when i started posting that strings are not like arrays!

And then i thought

var string = “[1,2,3], [4,5,6],[7,8,9]” and so on…

Basically, you can put whatever in a string, cantcha?

But you don’t really have an array in a string in that case… You’d have to parse for half an hour before you can reconstruct the array :slight_smile:

Hey, YOU were saying they’re the same, and now you deny the obvious?! lol

It’s not one array, it’s 3 of em in that string, so you’d just split at “,” and then array1 = resultOfSplit[0], array2 = resultOfSplit[1} etc…

You split at “,”, hue? And how many “,” do you have, Eyez? :stuck_out_tongue:

Fais ch… LOL ta gueule! :stuck_out_tongue: (je rigole…)
ok, replace the ones between the [] by sthing else to split…

:stuck_out_tongue:

*Originally posted by ilyaslamasse *
“Strings are a very particular kind of arrays… Or do you disagree?”

i disagree. a string is a flat, literal datatype. an array is more like a reference to information. it can contain strings, objects, more arrays, booleans, etc. just about anything, and just about any number of anything.

ever loaded a bunch of movie references into an array to work with all of them at once? try that with a string. sure, you could have them comma delimited and then split them into an array and then evaluate th… hold on, did you just change it into an array? see what i mean?

it’s not that they have no similarities, it’s just that they have so many more differences.

Hmm… [SIZE=1]I’m just arguing now because French people have to argue to the death…even if they’re wrong (I’m not saying it is the case here :P)[/SIZE]

OK, no, forget it. I’m convinced :slight_smile: Even though you’ll agree that Arrays and Strings are a bit alike :stuck_out_tongue: [SIZE=1]Overwhelming Frenchood mode engaged[/SIZE]

pom :asian:

ilyaslamasse.removeMovieClip(now);
discussion.stop(now);
var useless = true;

if (useless == true){
var funny = true also;
}else{
lol;
}

I like this thread, let’s put it in an array!
Then we split it up between all posters,
parse it, send it to an XML socket and
unescape everything before going nuts…

:stuck_out_tongue: :slight_smile: =)

nice code there eyez… I almost wet myself. (no not really… it’s just an expression. been using roflmao too many times lately)

Hey you can’t remove me like that! Read the AS dictionary more carefully

[SIZE=3]Ilyaslamasse.overWhelmingFrenchhood[/SIZE]

**Syntax **

myIlyaslamasse.overWhelmingFrenchhood=true;

**Arguments **

none

**Description **

Property; turns your Ilyaslamasse object into a super object, impossible to delete, and subsequently never wrong about anything.

**Player **

Flash 5 or later.

**Example **

The following example creates an Ilyaslamasse and use the overWhelmingFrenchhood property.

myI=new Ilyaslamasse();
myS=new Supra();
myE=new EyezBerg();
myI.overWhelmingFrenchhood=true;
myE.deleteMovieClip(myI);
// returns false
myS.isWrong(myI);
//returns true

pom :asian: