Hello,

I had written a script previously in Ruby that would parse a string of
dots and dashes (without separators) and return all possible morse
code translations however I now need to accomplish the same feat in
C#.  Would anyone happen to have any pointers for doing this in C#
without running into memory issues with large strings (15 or more
characters)?

Ruby:

def self.words(code = @code, prefix = '')
  results = []
  if code == ''
    results << prefix if @@words.nil? || @@words.include?(prefix)
  else
    LETTER.sort.each do |l, p|
        if code[0, p.length] == p
          results += words(code[p.length,code.length], prefix + l)
        end
    end
  end
  results
end

Reply via email to