写一个函数
vowel2index(STR) vowel2index(STR) vowel_2_index vowel_2_index Vowel2Index(字符串s) vowel2Index(字符串或多个)取入的字符串和替换所有的元音[A,E,I,O,U]与字符串内它们各自的位置. E.g:
vowel2index( '这是我的字符串')== '6S我str15ng th3s' vowel2index( 'Codewars是世界上最好的网站')== 'C2d4w6rs 10S TH15 b18st s23t25 27N TH32 w35rld' vowel2index( '')== '' vowel_2_index( '这是我的字符串')== '6S我str15ng th3s' vowel_2_index( 'Codewars是世界上最好的网站')== 'C2d4w6rs 10S TH15 b18st s23t25 27N TH32 w35rld' vowel_2_index( '')== '' vowel_2_index( '这是我的字符串')== '6S我str15ng th3s' vowel_2_index( 'Codewars是世界上最好的网站')== 'C2d4w6rs 10S TH15 b18st s23t25 27N TH32 w35rld' vowel_2_index( '')== '' vowel2index"这是我的字符串" =="th3s 6S我str15ng" vowel2index 'Codewars是世界上最好的网站' == 'C2d4w6rs 10S TH15 b18st s23t25 27N TH32 w35rld' vowel2index '' == '' Kata.Vowel2Index( "这是我的字符串")== "th3s 6S我str15ng" Kata.Vowel2Index( "Codewars是世界上最好的网站")== "C2d4w6rs 10S TH15 b18st s23t25 27N TH32 w35rld" Kata.Vowel2Index( "这是我的字符串")== "th3s 6S我str15ng" Kata.Vowel2Index( "Codewars是世界上最好的网站")== "C2d4w6rs 10S TH15 b18st s23t25 27N TH32 w35rld" vowel2Index"这是我的字符串" =="th3s 6S我str15ng" vowel2Index "Codewars是世界上最好的网站" == "C2d4w6rs 10S TH15 b18st s23t25 27N TH32 w35rld"您函数应不区分大小写的元音.
点击查看答案
csharp基础练习题:猫年,狗年【难度:0级】–景越C# 经典编程题库,不同难度C# 练习题,适合自学C# 的新手进阶训练
本博客所有编程题目及答案均收集自互联网,主要用于供网友学习参考,如有侵犯你的权益请联系管理员及时删除,谢谢 题目收集至https://www.codewars.com/ https://www.codewars.com/kata/the-old-switcheroo
