Flash Q: delete txt from a string
- Started
- Last post
- 3 Responses
- mightyj0
Thanks guys, this helps quite a bit!
- PonyBoy0
you could also 'split' the string using the split() method of the String class... find the word and then drop the second string created when you split it...
- fyoucher10
String class:
indexOf and substring
indexOf to get first occurance of the word 'Daily', use the index for D to use for the endIndex for substring's param. Subtring will return a new string from whereever you want to start (0 index probably) to that D (or D's index - 1 or 2)
- mightyj
In as3 how would I go about deleting a portion of text from the end of a string.
Currently I load text in from an xml file into 12 different objects. Each object has a paragraph of text. There is some text at the end of each paragraph that I would like to get rid of. The text starts with the word "Daily". I assume there must be a way to code - get rid of anything from "Daily" on. Any help would be great. Thanks in advance.