6 kyu

Split Strings

57,519 of 167,597jhoffner

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 Trained313935
Total Skips28085
Total Code Submissions467516
Total Times Completed167597
JavaScript Completions55491
Ruby Completions4662
CoffeeScript Completions225
PHP Completions6945
C# Completions9825
Python Completions57519
Haskell Completions1857
Elixir Completions585
Crystal Completions60
Go Completions4461
PowerShell Completions240
Scala Completions686
Julia Completions143
Clojure Completions308
C++ Completions8775
Java Completions16290
Prolog Completions31
Groovy Completions85
Rust Completions2097
COBOL Completions10
Factor Completions16
Swift Completions309
R Completions51
Dart Completions172
Kotlin Completions82
BF Completions4
Total Stars2216
% of votes with a positive feedback rating89% of 11935
Total "Very Satisfied" Votes9604
Total "Somewhat Satisfied" Votes2133
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