7stud2
(7stud --)
1
data = "<input type=\"password\" value=\"hoax\">"
spl = data.split("\"password\"")
The first example works exactly like it should, but when i'm loading the
same line from file it doesn't, even though they are both strings.
Here is the second example
fp = File.open('file','r').read
spl = data.split(/\\"password\"")
How come i can't use the first approach? Is there really difference
between string and a string?
···
--
Posted via http://www.ruby-forum.com/.
Chris6
(Chris)
3
and add / to mark the end of the RegEx
···
On Thu, Sep 26, 2013 at 2:05 PM, Ryan Davis <ryand-ruby@zenspider.com>wrote:
On Sep 26, 2013, at 7:04, Michael James <lists@ruby-forum.com> wrote:
> spl = data.split(/\\"password\"")
\\ -> \
7stud2
(7stud --)
4
PS: dont use
File.open('file','r').read
because it holds the FilePointer Open, use
File.read('file')
···
--
Posted via http://www.ruby-forum.com/.