7 kyu

Tea for two

2,833 of 2,834ransy

Description:

Tea for two!

Given a string or number write a function tea42 that takes as input a string or number and returns a string where every '2' charcter or digit has been replaced with a t.

tea42('coffee') //should return 'coffee'
tea42('tea') //should return 'tea'
tea42('2ea') //should return 'tea'
tea42(9022) //should return '90tt'
tea42(5676765) //should return '5676765'
tea42('2u2u') //should return 'tutu'
Fundamentals
Strings

More By Author:

Check out these other kata created by ransy

Stats:

CreatedMay 19, 2015
PublishedMay 19, 2015
Warriors Trained4078
Total Skips253
Total Code Submissions7736
Total Times Completed2834
JavaScript Completions2833
CoffeeScript Completions11
Total Stars27
% of votes with a positive feedback rating92% of 373
Total "Very Satisfied" Votes320
Total "Somewhat Satisfied" Votes44
Total "Not Satisfied" Votes9
Ad
Contributors
  • ransy Avatar
  • jhoffner Avatar
  • larrybotha Avatar
Ad