I
Ion Frantzis
Hey all,
I need some help. I'm having some problems with strings in Ruby.
More specifically I keep having to explicitly convert string to
strings. Let me say that I've had some problems with my system and
I've had to uninstall and reinstall ruby from the one-click installer
for Windows 'ruby 185-21.exe'. This might be unrelated though.
Below is the code in question the current_message object is a simple
mail object its just simple way for me to keep the various mail
section in one object. The first line with the Regular expression
work with out error. The problem is I don't understand why I need to
specify to_s for displayName when I'm parsing out the first and last
name. I had to specify to_s again when I reused firstName and
lastName later in my code.
displayName = current_message.Body.scan(/^Employee Name -+> (.*)\./)
firstName = displayName.to_s.split(", ")[1]
lastName = displayName.to_s.split(", ")[0]
searchUser = lastName.to_s.downcase[0,3] + firstName.to_s.downcase[0,1] + "*"
Any clues as to what might cause something like this to happen would
be much appreciated.
C.Particle
I need some help. I'm having some problems with strings in Ruby.
More specifically I keep having to explicitly convert string to
strings. Let me say that I've had some problems with my system and
I've had to uninstall and reinstall ruby from the one-click installer
for Windows 'ruby 185-21.exe'. This might be unrelated though.
Below is the code in question the current_message object is a simple
mail object its just simple way for me to keep the various mail
section in one object. The first line with the Regular expression
work with out error. The problem is I don't understand why I need to
specify to_s for displayName when I'm parsing out the first and last
name. I had to specify to_s again when I reused firstName and
lastName later in my code.
displayName = current_message.Body.scan(/^Employee Name -+> (.*)\./)
firstName = displayName.to_s.split(", ")[1]
lastName = displayName.to_s.split(", ")[0]
searchUser = lastName.to_s.downcase[0,3] + firstName.to_s.downcase[0,1] + "*"
Any clues as to what might cause something like this to happen would
be much appreciated.
C.Particle