g | x | w | all
Bytes Lang Time Link
056Arturo240701T144723Zchunes
063Ruby240701T141158Zint 21h
007Uiua SBCS240630T171626Zchunes
056R240630T125936Zint 21h
041Brev220621T120132ZSandra
005Pip220612T035714ZnaffetS
085Red220612T043440Zchunes
039rSNBATWPL220612T025127ZnaffetS
034Factor220612T013842Zchunes
003Vyxal d220611T233102ZnaffetS
050PowerShell Core201030T033159ZJulian
003Japt P201029T230240ZShaggy
9291PHP190821T215155Z640KB
005Stax190821T211718ZKhuldrae
003Jelly190821T203325ZUnrelate
1530𝔼𝕊𝕄𝕚𝕟151123T033323ZMama Fun
033Perl 6151129T190503ZBrad Gil
004GS2151123T011438ZDennis
012Japt151123T010316ZDowngoat
166Ceylon151123T232317ZPaŭlo Eb
036Haskell151123T173516Znimi
043Clojure/ClojureScript151123T173507ZMattPutn
051Mathematica151123T172015ZLegionMa
152C++14151123T145431ZZereges
009TeaScript151123T004104ZDowngoat
010K151123T041842ZJohnE
015Octave151123T030600Zalephalp
008GolfScript151123T003638ZDennis
057JavaScript ES6151123T013739ZGeorge R
046Minkolang 0.13151123T013420ZEl'e
048Python151123T005224ZDennis
046Julia151123T011221ZAlex A.
005Pyth151123T002458ZMaltysen
005CJam151123T002513Zgeokavel

Arturo, 56 bytes

$->a->join flatten map size a\0'i->sort map a'x->x\[i-1]

Try it!

Ruby, 63 bytes

->s{r=[];for j in 0..s[0].size;r<<s.map{_1[j]}.sort;end;r.join}

Attempt This Online!

Uiua SBCS, 7 bytes

♭≡⊏⊸≡⍏⍉

Try it!

R, 56 bytes

\(a,`^`=Reduce)paste0^apply(rbind^strsplit(a,""),2,sort)

Attempt This Online!

It seems that to get the shortest solution one should avoid those quite verbose calculations of the length: be it nchar() or length().

Here is a function that inputs a vector of strings and outputs a concatenated string with the sorted characters.

Brev, 53 41 bytes

(as-list flatten(over(sort args char<?)))

Example:

((as-list flatten (over (sort args char<?))) "HELLO" "world" "!!!!!")

Pip, 5 bytes

SS*Zg

Attempt This Online!

Red, 85 bytes

func[b][repeat c length? b/1[foreach a sort collect[foreach m b[keep m/:c]][prin a]]]

Try it online!

rSNBATWPL, 39 bytes

x~strfor{flip$x}{y~y sort>}crush-with""

Try It Online!

Factor, 34 bytes

[ flip [ natural-sort ] map-flat ]

Attempt This Online!

Vyxal d, 3 bytes

∩vs

Try it Online!

PowerShell Core, 56 50 bytes

-join(($a=$args)[0]|% t*y|%{$a|% c*rs($i++)|sort})

-6 bytes thanks to mazzy

Try it online!

Japt -P, 3 bytes

Õmñ

Try it here

PHP, 92 91 bytes

for($argv[0]='';$a=array_column(array_map(str_split,$argv),$i++|0);print join($a))sort($a);

Try it online!

I'm confident this could be done shorter by not trying to use PHP's built-in array functions, but had to try!

Or 85 bytes

@Night2's swing, done shorter by not trying to use PHP's built-in array functions:

for(;''<$argv[1][$i++];print join($a))for($a=[];''<$a[]=$argv[++$$i][$i-1];sort($a));

Try it online!

Stax, 5 bytes

LMFop

So close to LMNOP :(

Run and debug it at staxlang.xyz!

Put all inputs into one list of strings (L), and transpose this list (M). For each resulting string (F), sort (o) and print (p) it.

Jelly, 3 bytes

ZṢ€

Try it online!

Only valid if considered as a full program: the resulting value is a list of strings, but when it's printed Jelly implicitly flattens it.

  €    Map
 Ṣ     sort
Z      over the columns of the input.

𝔼𝕊𝕄𝕚𝕟, 15 chars / 30 bytes

Ѩťªï)ć⇀ѨŌ$ø⬯)ø⬯

Try it here (Firefox only).

Just realized that Lodash's sortBy function works on strings, too.

Perl 6, 33 bytes

{[~] flat ([Z] @_».comb)».sort}

Example usage:

say {[~] flat ([Z] @_».comb)».sort}(< abc cba >) # acbbca

my &code = my $code = {[~] flat ([Z] @_».comb)».sort}

say code "HELLO","world","!!!!!"; # !Hw!Eo!Lr!Ll!Od

say ((<cba abc>),(<testing gnitset gttseni>)).map($code);
# (acbbac ggtentiststteisenngit)

GS2, 4 bytes

*Ü■/

This reads the strings from STDIN, separated by linefeeds.

The source code uses the CP437 encoding. Try it online!

Test run

$ xxd -r -ps <<< '2a 9a fe 2f' > zip-sort.gs2
$ echo -e 'HELLO\nworld\n!!!!!' | gs2 zip-sort.gs2 
!Hw!Eo!Lr!Ll!Od

How it works

*       Split the input into the array of its lines.
 Ü      Zip the resulting array.
  ■     Map the rest of the program over the resulting array.
   /        Sort.

Japt, 12 bytes 20

Ny m_q n q)q

Try it online!

Explanation

Ny       // Transpose inputs
  m_     // Maps through each new string
    q    // Split string
    n    // Sort string
    q    // Join
)q       // Join again

Ceylon, 166

String z(String+l)=>String(expand(t(l).map(sort)));[T+]n<T>(T?+i)=>[for(e in i)e else nothing];{[X+]*}t<X>([{X*}+]l)=>l[0].empty then{}else{n(*l*.first),*t(l*.rest)};

While Ceylon has a zip function, it takes only two iterables instead of an iterable of them. unzip, on the other hand, takes an iterable of tuples, and I don't want to convert my strings into tuples. So I implemented my own transpose function, inspired by a Haskell implementation which Google found for me somewhere.

// zip-sort
//
// Question:  http://codegolf.stackexchange.com/q/64526/2338
// My answer: ...

// Takes a list of strings (same length), and produces
// a string made by concatenating the results of sorting
// the characters at each position.
String z(String+ l) =>
        String(expand(t(l).map(sort)));

// Narrow an iterable of potential optionals to their non-optional values,
// throwing an AssertionError if a null is in there.
[T+] n<T>(T?+ i) =>
        [for (e in i) e else nothing];

// Transpose a nonempty sequence of iterables, producing an iterable of
// sequences.
// If the iterables don't have the same size, either too long ones are
// cut off or too short ones cause an AssertionError while iterating.
{[X+]*} t<X>([{X*}+] l) =>
        l[0].empty
        then {}
        else { n(*l*.first), *t(l*.rest) };

The types of n and t could be defined much more general, but this is Codegolf ;-) (n is a special case of what I proposed as assertNarrow two weeks ago).

Haskell, 39 36 bytes

import Data.List
(>>=sort).transpose

Usage example: ((>>=sort).transpose) ["HELLO","world","!!!!!"] -> "!Hw!Eo!Lr!Ll!Od".

Transpose the list of strings, map sort over it and concatenate the resulting list of strings (>>= in list context is concatMap).

Clojure/ClojureScript, 43 bytes

#(apply str(mapcat sort(apply map list %)))

Creates an anonymous function. Written in a ClojueScript REPL, should also be valid Clojure.

Enter it here, then call via (*1 ["HELLO" "world" "!!!!!"]). Or do (def f *1) and then use (f ["abc" "cba"]).

Mathematica, 51 bytes

""<>SortBy@ToCharacterCode/@Transpose@Characters@#&

String manipulation in Mathematica is expensive...

C++14, 152 bytes

#include<iostream>
#include<regex>
[](auto s){for(int i=0;i<s[0].size();++i){auto r=""s;for(auto k:s)r+=k[i];std::sort(begin(r),end(r));std::cout<<r;}};

Not using any advantage of map+zip (guess why)

Ungolfed + usage

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>

int main()
{
    auto lambda = [](auto s)
    {
        for (int i = 0; i < s[0].size(); ++i)
        {
            auto r = ""s;
            for (auto k : s)
                r += k[i];
            std::sort(begin(r), end(r));
            std::cout << r;
        }
    };

    std::vector<std::string> data = { "HELLO", "world", "!!!!!" };
    lambda(data);
}

TeaScript, 9 bytes

_t¡ßlp¡)µ

TeaScript has all the right built-ins implemented in all the wrong ways.

Try it online

Ungolfed

_t()m(#lp())j``

Explanation

_t()        // Transposes input array
    m(#     // Loops through inputs
       lp() // Sorts characters by char code
     )
j``         // Joins back into string

K, 10 bytes

,/{x@<x}'+

Join (,/) the sort of ({x@<x}) each (') of the transpose (+) of a list of strings.

In action:

  ,/{x@<x}'+("HELLO";"world";"!!!!!")
"!Hw!Eo!Lr!Ll!Od"

Simple, but K is hurt a bit here by not having a single-character sort function and instead dividing the operation into a scatter-gather index operator @ and a primitive which yields the permutation vector which would sort a list <.

Octave, 15 bytes

@(a)sort(a)(:)'

Example:

octave:1> (@(a)sort(a)(:)')(["abc";"cba"])
ans = acbbac
octave:2> (@(a)sort(a)(:)')(["HELLO";"world";"!!!!!"])
ans = !Hw!Eo!Lr!Ll!Od

GolfScript, 8 bytes

~zip{$}%

Try it online on Web GolfScript.

How it works

~         # Evaluate the input.
 zip      # Zip it.
    {$}%  # Map sort ($) over the resulting array.

JavaScript (ES6), 57 bytes

a=>a[0].replace(/./g,(c,i)=>a.map(w=>w[i]).sort().join``)

Minkolang 0.13, 46 bytes

$od0Z2:$zIz:$xd0G2-[i1+z[di0c*+c$r]xz$(sr$Ok].

Try it here. Expects input like "HELLO""world""!!!!!" (so no commas).

Explanation

$o     Read in whole input as characters
d      Duplicate top of stack (the ")
0Z     Count how often this appears in the stack
2:     Divide by two
$z     Store this in the register (z)
Iz:    Length of stack divided by z (k)
$x     Dump one element from the front/bottom of stack
d      Duplicate top of stack (which is k)
0G     Insert it at the front/bottom of stack
2-     k-2

  [                              Open for loop that repeats k-2 times
   i1+                           Loop counter + 1 (i)
      z[                         Open for loop that repeats z times
        d                        Duplicate top of stack (which is i)
         i                       Loop counter (j)
          0c                     Copy k from front of stack
            *                    Multiply (j*k)
             +                   Add (j*k + i)
              c                  Copy character at position j*k+i to the top
               $r                Swap top two elements of stack (so i is on top)
                 ]               Close for loop
                  x              Dump the top of stack (dump i)
                   z$(           Start a new loop with the top z elements
                      s          Sort
                       r$O       Reverse and output the whole (loop) stack as characters
                          k      Break - exits while loop
                           ].    Close for loop and stop

Python, 50 48 bytes

lambda x,y=''.join:y(map(y,map(sorted,zip(*x))))

Thanks to @xnor for -2 bytes!

Julia, 46 bytes

x->(j=join)(map(i->j(sort([i...])),zip(x...)))

This creates an unnamed function that accepts an array of strings and returns a string. To call it, give it a name, e.g. f=x->....

Ungolfed:

function zipsort{T<:AbstractString}(x::Array{T,1})
    # Splat the input array and zip into an iterable
    z = zip(x...)

    # For each tuple consisting of corresponding characters
    # in the input array's elements, splat into an array,
    # sort the array, and join it into a string
    m = map(i -> join(sort([i...])), z)

    # Take the resulting string array and join it
    return join(m)
end

Pyth, 5 bytes

Zips(C) the input(Q), Maps Sort, then sums.

sSMCQ

Try it online.

CJam, 5 bytes

q~z:$

Try it here.