Founding Batch Offer · HLD · LLD · System Design at ₹799 until 30 Nov

ProgramsLogic building

Phase 5 - Category 4: String Transformation

Transform strings - replace, remove, insert operations.

10 programs · open one, then the next

Start with Replace Character
  1. 01Replace CharacterIntermediateReplace matching text with str.replace. Students read a target and replacement, preserve the source string, and learn that the API accepts substrings too.Open example →
  2. 02Remove CharacterIntermediateRemove chosen text with replace and an empty replacement. Students distinguish deleting all matching substrings from deleting a character at a particular index.Open example →
  3. 03Insert Character at PositionIntermediateInsert text at a validated string position using slices. Students join prefix, inserted text, and suffix and include the position just after the character.Open example →
  4. 04Remove First CharacterBeginnerRemove the first character of text with slicing. Students guard empty input, retain the remaining sequence, and see why a one-character result becomes empty.Open example →
  5. 05Remove Last CharacterBeginnerDrop the character with a slice. Students trace an excluded negative endpoint and distinguish removing one position from stripping repeated trailing characters.Open example →
  6. 06Swap First and Last CharacterIntermediateSwap a string's endpoint characters with concatenation and slicing. Students retain the middle substring and require at least two positions before swapping.Open example →
  7. 07Duplicate String N TimesBeginnerRepeat a string n times with multiplication. Students distinguish numeric multiplication from text repetition and test zero or negative repeat counts honestly.Open example →
  8. 08Add Characters Between Each CharacterIntermediateInsert a separator between string characters with join. Students treat a string as an iterable of characters and avoid adding separators at either endpoint.Open example →
  9. 09Remove All Occurrences of SubstringIntermediateRemove all nonoverlapping substring matches with Python replace. Students preserve unmatched text and distinguish literal matching from regular expressions.Open example →
  10. 10Reverse Each WordIntermediateReverse the letters inside each word while keeping word order. Students combine split, a list comprehension, character slicing, and a final single-space join.Open example →