6 kyu

Split Strings

57,617 of 167,856jhoffner

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 Trained314373
Total Skips28109
Total Code Submissions468141
Total Times Completed167856
JavaScript Completions55558
Ruby Completions4665
CoffeeScript Completions225
PHP Completions6953
C# Completions9847
Python Completions57617
Haskell Completions1858
Elixir Completions585
Crystal Completions61
Go Completions4467
PowerShell Completions241
Scala Completions686
Julia Completions143
Clojure Completions308
C++ Completions8792
Java Completions16316
Prolog Completions32
Groovy Completions85
Rust Completions2101
COBOL Completions10
Factor Completions16
Swift Completions310
R Completions52
Dart Completions173
Kotlin Completions87
BF Completions5
Total Stars2218
% of votes with a positive feedback rating89% of 11944
Total "Very Satisfied" Votes9613
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