From: Marc Hoeppner Date: 2007-07-19T19:31:12+09:00 Subject: identify and extract positions from a string - how to? Hi, I am not quite sure about how to approach the following problem: I have a long (long long long) string of letters, a genomic sequence (600k characters+). Now, what I want to do is to extract certain parts of this string, based on the position. So for example lets say I want all characters from position 2340 to 5436. A quick pointer in the right direction would be much appreciated. I have a vague idea that it could perhaps be done with count? Like "puts string where string.count("actg")=2340 until string.count("actg")=5436"... ? Not sure tho, and probably there are better ways. Cheers, Marc -- Posted via http://www.ruby-forum.com/.