|
Author |
Topic: conditional data storing using loadstrings (Read 321 times) |
|
Jean-Jacques
|
conditional data storing using loadstrings
« on: Jan 14th, 2004, 1:52pm » |
|
Thanks to Koenie i've learned how to store a text file into an array using loadstreams. As my .txt file is in fact an html file now i would like to store into an array just the text and not the html tags. Is it possible to use regular expressions ? Is there another to way to accomplish this ? Thanks !
|
|
|
|
Jean-Jacques
|
Re: conditional data storing using loadstrings
« Reply #1 on: Jan 14th, 2004, 2:59pm » |
|
Apparently in the reference there's this about array: "The data at this location can be defined with the syntax array[element] = value or read with the syntax value = array[element]. Is it a way ?
|
|
|
|
Koenie
|
Re: conditional data storing using loadstrings
« Reply #2 on: Jan 14th, 2004, 4:18pm » |
|
I guess using regular expressions is a good idea. Some code to get started: Code:String nonFormattedString = "bad always wins, because bad rules"; String formattedString = nonFormattedString.replaceAll("bad", "good"); println(formattedString); |
| Koenie
|
http://koeniedesign.com
|
|
|
Jean-Jacques
|
Re: conditional data storing using loadstrings
« Reply #3 on: Jan 14th, 2004, 7:43pm » |
|
Thanks Koenie ! In order to developp my self-Help habbits with processing i would like to know how did you find something about .replaceAll ? because i searched the website for replaceall and i fund nothing excepted your last answer.
|
« Last Edit: Jan 14th, 2004, 7:45pm by Jean-Jacques » |
|
|
|
|
Bijeoma
|
Re: conditional data storing using loadstrings
« Reply #4 on: Jan 14th, 2004, 8:28pm » |
|
replaceall is a method (function) of the string class. you can find all java's classes and the classe's methods here: http://java.sun.com/j2se/1.4.2/docs/api/ bryan
|
« Last Edit: Jan 14th, 2004, 8:30pm by Bijeoma » |
|
|
|
|
Jean-Jacques
|
Re: conditional data storing using loadstrings
« Reply #5 on: Jan 14th, 2004, 9:26pm » |
|
thanks for all your advices. I'm soo happy to learn !
|
|
|
|
|