In PHP we have a function called Trim() to remove characters from a string. However there are no the equivalent to PHP’s trim in Flash. But most time we need to trim a string with extra white space, so we can do only write this by ourselves. The following is 7 actionscript function which can do the same. They might help someone else. *If you know more please don’t hesitate to leave a comment.
Posts Tagged ‘function’
Question piled upon a question. After we know how to define the functions, we need to know how to use it.
In the previous section, we talk about how to declare a function by using the function statements. Today, I’ll show you another way to declare the functions.
Continue with the previous section. After we know what function is, maybe we need to know another thing when we calling the functions, the program flow.
In last section, we use the printScore() stands for a block of code, in order to get rid of the redundancy and make the code more easier to maintain.
After the discussion about conditionals and looping, let’s turn to the new topic, function. Before our discussion, let’s do some practice first.
Of course if you had wrote your proudly number format function,don’t only stock in your hard disk( or your head), let’s share!