Question d’entretien chez Pocket Gems

How to find a sub-string in a string? How to convert a ternary expression into a binary tree structure?