• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

split() ,collect() and slice() in ruby

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am doing search module in my project. it needs to split sequence of strings to perform the task effectively. it's not properly working while we enter the search keyword as blank and some of like ! @ # $ % ^ & * ( ) _ + | } { : " < > ? / . , ' ; ] [ .how do i perform the search effectively.

Thank you
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you give an example input/output? Maybe show some code you've already tried?

So far all I can tell is there needs to be something that splits strings based on some criteria and that certain characters are causing the output to be wrong but with no explanation or example of what a correct or incorrect output would look like.

For example can you provide us something like:
I need to take the string "Hi,there,dude!" and split it into a list of strings using the comma as a delimiter so I get three separate strings of "Hi" "there" and "dude!".
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic