Return to Snippet

Revision: 56084
at March 9, 2012 02:15 by izaiasdotcom


Initial Code
function splitString(str:String):Array {
	var r:RegExp = /\W+/g;
	return str.split(r));
}

Initial URL

                                

Initial Description
Easily breaks a string into an array of words.

*If your string has special characters such as latin, add those characters to the r var. Just like var r:RegExp = /[^\wçàáâãèéêìíîòóôõùúûüÀÁÇÂÃÈÉÊÌÍÎÒÓÔÕÙÚÛÜ¡]+/g;

Initial Title
Split string into Array

Initial Tags
array

Initial Language
ActionScript 3