← all problems

removeFirst 🌶️🌶️

Write a method that takes two String parameters, text and target, and returns text with the first occurrence of target removed. For example, removeFirst("banana", "an") should return "bana" (only the first "an" goes), and removeFirst("hello", "l") should return "helo". You may assume target appears in text at least once.