6 kyu

Split Strings

55,895 of 169,140jhoffner

Description:

Complete the solution so that it splits the string into pairs of two characters. If the string contains an odd number of characters then it should replace the missing second character of the final pair with an underscore ('_').

Examples:

* 'abc' =>  ['ab', 'c_']
* 'abcdef' => ['ab', 'cd', 'ef']
Regular Expressions
Strings
Algorithms

Stats:

CreatedApr 4, 2013
PublishedJul 25, 2013
Warriors Trained316611
Total Skips28229
Total Code Submissions470998
Total Times Completed169140
JavaScript Completions55895
Ruby Completions4673
CoffeeScript Completions225
PHP Completions6987
C# Completions9906
Python Completions58111
Haskell Completions1867
Elixir Completions589
Crystal Completions61
Go Completions4507
PowerShell Completions242
Scala Completions689
Julia Completions144
Clojure Completions308
C++ Completions8886
Java Completions16476
Prolog Completions32
Groovy Completions85
Rust Completions2128
COBOL Completions10
Factor Completions16
Swift Completions322
R Completions53
Dart Completions189
Kotlin Completions101
BF Completions5
Total Stars2225
% of votes with a positive feedback rating89% of 11996
Total "Very Satisfied" Votes9655
Total "Somewhat Satisfied" Votes2143
Total "Not Satisfied" Votes198
Ad
Contributors
  • jhoffner Avatar
  • stiell Avatar
  • Unnamed Avatar
  • GiacomoSorbi Avatar
  • suic Avatar
  • candrabeqx Avatar
  • Chrono79 Avatar
  • imjasonmiller Avatar
  • user5036852 Avatar
  • MartinPescatore Avatar
  • B1ts Avatar
  • davejones Avatar
  • Blind4Basics Avatar
  • Voile Avatar
  • Madjosz Avatar
  • kunicmarko20 Avatar
  • clcraig Avatar
  • monadius Avatar
  • user9644768 Avatar
  • hobovsky Avatar
  • Console Cowboy Avatar
  • xavierguihot Avatar
  • stellartux Avatar
  • user8436785 Avatar
  • gargamel Avatar
  • ejini战神 Avatar
  • akar-0 Avatar
  • Kacarott Avatar
  • tri@ Avatar
  • AVElfallah Avatar
  • KayleighWasTaken Avatar
  • CClairvoyant Avatar
  • YurichBRO Avatar
  • saudiGuy Avatar
  • Smrtypants Avatar
Ad