[Question]
  [
Don't you love those [exploded-view diagrams](https://en.wikipedia.org/wiki/Exploded-view_drawing)  in which a machine or object is taken apart into its smallest pieces?
[![enter image description here](https://i.stack.imgur.com/6lcse.jpg)](https://i.stack.imgur.com/6lcse.jpg)
Let's do that to a string!
# The challenge
Write a program or function that
1. inputs a string containing only **printable ASCII characters**;
2. dissects the string into **groups of non-space equal characters** (the "pieces" of the string);
3. outputs those groups in any convenient format, with some **separator between groups**.
For example, given the string
```
Ah, abracadabra!
```
the output would be the following groups:
```
!
,
A
aaaaa
bb
c
d
h
rr
```
Each group in the output contains equal characters, with spaces removed. A newline has been used as separator between groups. More about allowed formats below.
# Rules
The **input** should be a string or an array of chars. It will only contain printable ASCII chars (the inclusive range from space to tilde). If your language does not support that, you can take the input in the form of numbers representing ASCII codes. 
You can assume that the input contains **at least one non-space character**.
The **output** should consist of **characters** (even if the input is by means of ASCII codes). There has to be an unambiguous **separator between groups**, different than any non-space character that may appear in the input.
If the output is via function return, it may also be an array or strings, or an array of arrays of chars, or similar structure. In that case the structure provides the necessary separation.
A separator **between characters** of each group is **optional**. If there is one, the same rule applies: it can't be a non-space character that may appear in the input. Also, it can't be the same separator as used between groups.
Other than that, the format is flexible. Here are some examples:
* The groups may be strings separated by newlines, as shown above.
* The groups may be separated by any non-ASCII character, such as `¬`. The output for the above input would be the string:
```
!¬,¬A¬aaaaa¬bb¬c¬d¬h¬rr
```
* The groups may be separated by *n*>1 spaces (even if *n* is variable), with chars between each group separated by a single space:
```
!  ,    A   a a a a a    b b  c       d   h  r r
```
* The output may also be an array or list of strings returned by a function:
```
['!', 'A', 'aaaaa', 'bb', 'c', 'd', 'h', 'rr']
```
* Or an array of char arrays:
```
[['!'], ['A'], ['a', 'a', 'a', 'a', 'a'], ['b', 'b'], ['c'], ['d'], ['h'], ['r', 'r']]
```
Examples of formats that are not allowed, according to the rules:
* A comma can't be used as separator (`!,,,A,a,a,a,a,a,b,b,c,d,h,r,r`), because the input may contain commas.
* It's not accepted to drop the separator between groups (`!,Aaaaaabbcdhrr`) or to use the same separator between groups and within groups (`! , A a a a a a b b c d h r r`).
The groups may appear in **any order** in the output. For example: alphabetical order (as in the examples above), order of first appearance in the string, ... The order need not be consistent or even deterministic.
Note that the input cannot contain newline characters, and `A` and `a` are different characters (grouping is **case-sentitive**).
Shortest code in bytes wins.
# Test cases
In each test case, first line is input, and the remaining lines are the output, with each group in a different line.
* Test case 1:
```
Ah, abracadabra!
!
,
A
aaaaa
bb
c
d
h
rr
```
* Test case 2:
```
\o/\o/\o/
///
\\\
ooo
```
* Test case 3:
```
A man, a plan, a canal: Panama!
!
,,
:
A
P
aaaaaaaaa
c
ll
mm
nnnn
p
```
* Test case 4:
```
"Show me how you do that trick, the one that makes me scream" she said
""
,
S
aaaaa
cc
dd
eeeeeee
hhhhhh
ii
kk
mmmm
n
ooooo
rr
ssss
tttttt
u
ww
y
```
  
[Answer]
# Python 3.5+, ~~77~~ ~~46~~ ~~44~~ 41 bytes
```
lambda s:[a*s.count(a)for a in{*s}-{' '}]
```
Pretty simple. Goes through the unique characters in the string by converting it to a set (using Python 3.5's extended iterable unpacking), then uses a list comprehension to construct the exploded diagrams by counting the number of times each character occurs in the string with `str.count`. We filter out spaces by removing them from the set.
The order of the output may vary from run to run; sets are unordered, so the order in which their items are processed, and thus this answer outputs, cannot be guaranteed.
This is a lambda expression; to use it, prefix `lambda` with `f=`.
~~[Try it on Ideone!](http://ideone.com/axnIfH)~~ Ideone uses Python 3.4, which isn't sufficient.
Usage example:
```
>>> f=lambda s:[a*s.count(a)for a in{*s}-{' '}]
>>> f('Ah, abracadabra!')
[',', 'A', 'aaaaa', 'd', '!', 'bb', 'h', 'c', 'rr']
```
*Saved 3 bytes thanks to @shooqie!*
[Answer]
# [Jelly](http://github.com/DennisMitchell/jelly), 5 bytes
```
ḟ⁶ṢŒg
```
[Try it online!](http://jelly.tryitonline.net/#code=4bif4oG24bmixZJn&input=&args=J0EgbWFuLCBhIHBsYW4sIGEgY2FuYWw6IFBhbmFtYSEn)
It does return an array, just that when it is printed to STDOUT, the separator is gone.
This is indeed a function that can be called [as such](http://jelly.tryitonline.net/#code=4bif4oG24bmixZJnCsOHxZLhuZg&input=&args=J0EgbWFuLCBhIHBsYW4sIGEgY2FuYWw6IFBhbmFtYSEn) (in Jelly, each line is a function).
```
ḟ⁶ṢŒg
ḟ⁶      filter out spaces
  Ṣ     sort
   Œg   group
```
[Answer]
# Retina, 13 bytes
```
O`.
!`(\S)\1*
```
The sorting is very easy (it's a builtin), it's separating the letters that takes 9 bytes. [Try it online!](http://retina.tryitonline.net/#code=T2AuCiFgKFxTKVwxKg&input=QWgsIGFicmFjYWRhYnJhIQ)
The first line s`O`rts all matches of the regex `.` (which is every character), giving us  `!,Aaaaaabbcdhrr`.
Match is the default stage for the last line of a program, and `!` makes it print a linefeed-separated list of matches of the regex. The regex looks for one or more instances of a non-space character in a row.
[Answer]
# [Perl 6](http://perl6.org), 28 bytes
```
*.comb(/\S/).Bag.kv.map(*x*)
```
Note that [Bag](https://docs.perl6.org/type/Bag) like a [Hash](https://docs.perl6.org/type/Hash) or [Set](https://docs.perl6.org/type/Set) is unordered so the order of results is not guaranteed.
## Explanation:
```
# Whatever lambda ｢*｣
# grab the characters
*.comb(
  # that aren't white-space characters
  /\S/
)
# ("A","h",",","a","b","r","a","c","a","d","a","b","r","a","!")
# Turn into a Bag ( weighted Set )
.Bag
# {"!"=>1,","=>1,"A"=>1,"a"=>5,"b"=>2,"c"=>1,"d"=>1,"h"=>1,"r"=>2}
# turn into a list of characters and counts
.kv
# ("!",1,",",1,"A",1,"a",5,"b",2,"c",1,"d",1,"h",1,"r",2)
# map over them 2 at a time
.map(
  # string repeat the character by the count
  * x *
)
# ("!",",","A","aaaaa","bb","c","d","h","rr")
```
[Answer]
# Vim, ~~50~~, 46 bytes
```
i <esc>:s/./&\r/g
:sor
qq:%s/\v(.)\n\1/\1\1
@qq@qD
```
Explanation/gif will come later.
[Answer]
## Pyth, 6
```
.gk-zd
```
[Try it here](https://pyth.herokuapp.com/?code=.gk-zd&input=Ah%2C%20abracadabra%21&debug=0) or run a [Test Suite](https://pyth.herokuapp.com/?code=.gk-zd&test_suite=1&test_suite_input=Ah%2C+abracadabra%21%0A%5Co%2F%5Co%2F%5Co%2F%0AA+man%2C+a+plan%2C+a+canal%3A+Panama%21%0A%22Show+me+how+you+do+that+trick%2C+the+one+that+makes+me+scream%22+she+said&debug=0).
Pretty simple, `-zd` removes spaces from the input, and `.gk` groups each remaining element by its value. Unfortunately, I haven't found a way to make use of auto-fill variables. Note that the output is shown as Python strings, so certain characters (read: backslashes) are escaped. If you want it to be more readable, add a `j` to the beginning of the code.
[Answer]
# [Brachylog](http://github.com/JCumin/Brachylog), ~~14~~ 7 bytes
**7 bytes thanks to Fatalize.**
```
:@Sxo@b
```
[Try it online!](http://brachylog.tryitonline.net/#code=OkBTeG9AYg&input=IkEgbWFuLCBhIHBsYW4sIGEgY2FuYWw6IFBhbmFtYSEi&args=Wg)
```
:@Sxo@b
:@Sx     remove spaces
    o    sort
     @b  group
```
[Answer]
## Haskell, 38 bytes
```
f s=[filter(==c)s|c<-['!'..],elem c s]
```
Basically [nimi's solution](https://codegolf.stackexchange.com/a/90993/20260), but explicitly checking only letters appearing in the string.
[Answer]
## JavaScript (ES6), 41 bytes
```
s=>[...s].sort().join``.match(/(\S)\1*/g)
```
[Answer]
# [2sable](http://github.com/Adriandmen/2sable), 7 bytes
Code:
```
Úð-vyÃ,
```
Explanation:
```
Ú       # Uniquify the string, aabbcc would result into abc
 ð-     # Remove spaces
   vy   # For each character...
     Ã  #   Keep those in the string, e.g. 'aabbcc', 'a' would result into 'aa'
      , #   Pop and print with a newline
```
Uses the **CP-1252** encoding. [Try it online!](http://2sable.tryitonline.net/#code=w5rDsC12ecODLA&input=QW5kIHRoZW4gRGVubmlzIHNhaWQ6ICJheXkgbG1hbywgbGV0IG1lIG91dGcwbGYgdSBpbiBqZWx5Ig)
[Answer]
## Haskell, 40 bytes
```
f x=[v:w|d<-['!'..],v:w<-[filter(==d)x]]
```
Usage example: `f "Ah, abracadabra!"`-> `["!",",","A","aaaaa","bb","c","d","h","rr"]`.
The pattern `v:w` matches only list with at least one element, so all characters not in the input are ignored.
Also 40 bytes:
```
import Data.List
group.sort.filter(>' ')
```
[Answer]
# Ruby, 41 + 1 = 42 bytes
+1 byte for `-n` flag.
```
gsub(/(\S)(?!.*\1)/){puts$1*$_.count($1)}
```
Takes input on stdin, e.g.:
```
$ echo 'Ah, abracadabra!' | ruby -ne 'gsub(/(\S)(?!.*\1)/){puts$1*$_.count($1)}'
A
h
,
c
d
bb
rr
aaaaa
!
```
[Answer]
## [><>](http://esolangs.org/wiki/Fish), 49 bytes
```
i:0(?v
84}0~/&{!*
v!?: <}/?=&:&:<
>&1+&}aol1-?!;^
```
Very spaciously wasteful in the output, but i assume is still allowed given the lenience of the rules
Explanation:
```
i:0(?v           Collects text from input
84}0~/&{!*       adds 32 (first ascii starting at space) to register and 0 to stack
v!?: <}/?=&:&:<  checks all characters to the current register, if equal:
       o         prints the character and continues looping
>&1+&}aol1-?!;^  when all characters are checked, adds 1 to register, prints a newline,
                 checks the stack length to halt the program if 0, and starts looping again
```
fit some things in pretty tight, even using jumps to get around some functions so i could run the pointer vertically.
Basically this puts each ASCII character on its own newline, and if none of that character exists, the line will be blank
[Try it online](https://fishlanguage.com/playground/ZmDkCSR8jYJqHsvJ9)
Edit: i was wrong there was an error in the code what would cause it to never complete if there was a space in the input
[Answer]
## PowerShell v2+, 44 bytes
```
[char[]]$args[0]-ne32|group|%{-join$_.Group}
```
Takes input `$args[0]` as a command-line argument literal string. Casts that as a `char`-array, and uses the `-n`ot `e`qual operator to pull out spaces (ASCII `32`). This works because casting has a higher order precedence, and when an array is used as the left-hand operator with a scalar as the right-hand, it acts like a filter.
We pass that array of characters to `Group-Object`, which does exactly what it says. Note that since we're passing *characters*, not strings, this properly groups with case-sensitivity.
Now, we've got a custom object(s) that has group names, counts, etc. If we just print that we'll have a host of extraneous output. So, we need to pipe those into a loop `|%{...}` and each iteration `-join` the `.Group` together into a single string. Those resultant strings are left on the pipeline, and output is implicit at program completion.
### Example
```
PS C:\Tools\Scripts\golfing> .\exploded-view-of-substrings.ps1 'Programming Puzzles and Code Golf'
PP
rr
ooo
gg
aa
mm
i
nn
u
zz
ll
ee
s
dd
C
G
f
```
[Answer]
# C# ~~125~~ 98 Bytes
```
using System.Linq;s=>s.GroupBy(c=>c).Where(g=>g.Key!=' ').Select(g=>new string(g.Key,g.Count())));
```
## Explanation
```
//Using anonymous function to remove the need for a full signature 
//And also allow the implicit return of an IEnumerable
s =>
    
    //Create the groupings
    s.GroupBy(c => c)
    //Remove spaces
    .Where(g=> g.Key!=' ')
    //Generate a new string using the grouping key (the character) and repeating it the correct number of times
    .Select(g => new string(g.Key, g.Count()));
```
* Thanks to @TheLethalCoder who suggested the use of an anonymous function, which also allowed me to remove the `ToArray` call and just implicitly return an IEnumerable which collectively saves 27 bytes
[Answer]
# R, ~~198~~ ~~189~~ ~~96~~ 95 bytes
```
for(i in unique(a<-strsplit(gsub(" ","",readline()),"")[[1]]))cat(rep(i,sum(a==i)),"\n",sep="")
```
**Ungolfed :**
```
a<-strsplit(gsub(" ","",readline()),"")[[1]] #Takes the input from the console
for(i in unique(a)) #loop over unique characters found in variable a
cat(rep(i,sum(a==i)),"\n",sep="") # print that character n times, where n was the number of times it appeared
```
~~This solution is currently not entirely working, when `\` are involved.~~  
*Now it is !*
Thank **a lot** you to @JDL for golfing out *102* bytes !
[Answer]
# Swift, ~~105~~ 91 bytes
Thanks to @NobodyNada for 14 bytes :)
Yeah, I'm pretty new to Swift...
```
func f(a:[Character]){for c in Set(a){for d in a{if c==d && c != " "{print(c)}}
print("")}}
```
Characters within a group are separated by a single newline. Groups are separated by two newlines.
[Answer]
# Mathematica, 36 bytes
Built-in functions `Gather` and `Characters` do most of the work here.
```
Gather@Select[Characters@#,#!=" "&]&
```
[Answer]
# Pyth, 5 bytes
```
.gksc
```
[Try it here!](https://pyth.herokuapp.com/?code=.gksc&input=%27%22Show+me+how+you+do+that+trick%2C+the+one+that+makes+me+scream%22+she+said%27&debug=0)
Takes input as a Python string (i.e. wrapped in quotes, escaped quotes and slashes as necessary).
Explanation:
```
    c    Split (implied) input on whitespace
   s     Sum together
.gk      Group by value
```
If you guarantee at least one space in the input, there's a 4-byte solution:
```
t.gk
```
[Try it here!](https://pyth.herokuapp.com/?code=t.gk&input=%27%22Show+me+how+you+do+that+trick%2C+the+one+that+makes+me+scream%22+she+said%27&debug=0)
Explanation:
```
 .gk (Q)  groups the characters in the string by their value
           this sorts them by their value, which guarantees that spaces are first
t         Remove the first element (the spaces)
```
[Answer]
# [Dyalog APL](http://goo.gl/9KrKoM), 11 [bytes](http://meta.codegolf.stackexchange.com/a/9429/43319)
Function returning list of strings.
```
(⊂∩¨∪)~∘' '
```
`(⊂∩¨∪)` the intersection of the entirety and its unique characters
`~∘' '` except spaces
[TryAPL online!](http://tryapl.org/?a=%28%28%u2282%u2229%A8%u222A%29%7E%u2218%27%20%27%29%A8%27Ah%2C%20abracadabra%21%27%20%27%5Co/%5Co/%5Co/%27%20%27A%20man%2C%20a%20plan%2C%20a%20canal%3A%20Panama%21%27%20%27%22Show%20me%20how%20you%20do%20that%20trick%2C%20the%20one%20that%20makes%20me%20scream%22%20she%20said%27&run)
[Answer]
# [Thunno 2](https://github.com/Thunno/Thunno2), 3 [bytes](https://github.com/Thunno/Thunno2/blob/main/docs/codepage.md)
```
ðoÑ
```
[Try it online!](https://Not-Thonnu.github.io/run#P2hlYWRlcj0mY29kZT0lQzMlQjBvJUMzJTkxJmZvb3Rlcj0maW5wdXQ9QWglMkMlMjBhYnJhY2FkYWJyYSEmZmxhZ3M9)
`ðo` removes spaces from the string. `Ñ` is a built-in for "group by". There is no body so it just groups identical characters together.
[Answer]
# [Japt](https://github.com/ETHproductions/japt) [`-R`](https://codegolf.meta.stackexchange.com/a/14339/), 6 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
ñ x ó¥
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&flags=LVI&code=8SB4IPOl&input=IkFoLCBhYnJhY2FkYWJyYSEi)
[Answer]
# [><> (Fish)](https://esolangs.org/wiki/Fish), ~~53~~ ~~50~~ 46 bytes
```
l'~')?v0
v?(0:i<]r+1r[
\~rvol-1
^?:<;?('!'l~oa
```
[Try it](https://mousetail.github.io/Fish/#eyJ0ZXh0IjoibCd+Jyk/djBcbnY/KDA6aTxdcisxcltcblxcfnJ2b2wtMVxuXj86PDs/KCchJ2x+b2EiLCJpbnB1dCI6In5+fiEhIUJCQiBDQ0NlZWUiLCJzdGFjayI6IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwICIsInN0YWNrX2Zvcm1hdCI6Im51bWJlcnMiLCJpbnB1dF9mb3JtYXQiOiJjaGFycyJ9)
Finally beat the current fish answer. Note the link pre-populates the stack to make it faster but this is unnecessary for the correctness of the program.
Each element of the stack stores how often the nth character appears in the input.
[![enter image description here](https://i.stack.imgur.com/cWriH.png)](https://i.stack.imgur.com/cWriH.png)
The top row pushes `ord('~')` 0s to the stack.
The second row reads the input. Use `[r1+r]` to get the nth element of the stack, add 1 to it, then put it back into place.
The left (red) half of the third row reverses the stack so the higher valued items are on the top. Now we know that the length of the stack is the character code of the count the top element represents. This allows very convenient printing.
The left (grey) half of the bottom row checks if the count of the nth character is 0. If so go to the right half of the third row.
The right (blue) half of the bottom row prints a line break `ao`. Then pops the top of the stack. If we now have less than `ord('!')` items on the stack only spaces remain and we exit (since we shouldn't print spaces)
The right half of the third row runs if there is more than one occurrence of the top character. If so, we subtract one occurrence, then print the length of the stack as a character.
[Answer]
# [R](https://www.r-project.org), 65 bytes
```
cat(strrep(z<-names(y<-table(strsplit(readline(),""))),y)[z>" "])
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72waMFNk6LUxJSczLxU27TSvOSSzPw8DU0lR4XcxDwdhUSFghwInZyYl5hjpRAApHITFZWWlpak6VrcdExOLNEoLikqSi3QqLLRBcqlFmtU2uiWJCblpIIkigtyMks0YDZoaOooKWlqaupUakZX2SkpKMVqQgxaAKWgNAA)
Full program that accepts input by reading a line from the terminal, and outputs a space-separated string of character-groups. The input & output are chosen to be directly comparable to the earlier R answers of [Billywob](https://codegolf.stackexchange.com/a/91944/95126) and [Frédéric](https://codegolf.stackexchange.com/a/91000/95126).
Nevertheless, we could also golf a little further within the original rules, by writing a function that accepts input as an array of characters, and outputs an array of strings:
# [R](https://www.r-project.org), 49 bytes
```
function(x)strrep(z<-names(y<-table(x)),y)[z>" "]
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72waMGiNNulpSVpuhY3DdNK85JLMvPzNCo0i0uKilILNKpsdPMSc1OLNSptdEsSk3JSgVKaOpWa0VV2SgpKsVCNTpl5BaUltkA9xQU5mSUaSo4KuYl5OgqJCgU5EDo5MS8xx0ohAEjlJioq6SgpaUZHG8bGcqVpgPVqQkxasABCAwA)
Note that this could be further shortened to [42 bytes](https://ato.pxeger.com/run?1=m72waMGiNNulpSVpuhY3tWI0KjSLS4qKUgs0qmx08xJzU4s1Km10SxKTclKBUpo6lZrRVXZKCkqxUB1OmXkFpSW2QD3FBTmZJRpKjgq5iXk6CokKBTkQOjkxLzHHSiEASOUmKirpKClpRkcbxsZypWmA9WpCTFqwAEIDAA) using a version of R that is more-recent than the challenge to allow us to exchange `function` for `\`.
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 59 bytes
Here's some JS solutions without regex. Uses linebreak as separators between groups.
```
s=>[...s].sort().map(c=>b==(b=c)?c:`
`+c,b=0).join``.trim()
```
[Try it online!](https://tio.run/##NY9Bb8IwDIXv/RVeT4koYWemgDhwR9qRIsV1U1po4irJNvHru1QVB@uznp/19B74i5HCMKWt59bOnZ6jPlyVUvGmIockpHI4CdKHRmvRaJJH2pvCbKhq9KdUDx68MSqFwQk5f10LAHPqK8AmIGG74MNUi1rXvHvPqpzAoc9WmMaVhB7HPVwy3Put/O75D5yFBS/@gZYh9ZggR9KzyrsF9nbVHD5tXMy5k0VXQszXiENripvqOJyRepELEvvIo1Uj30UnotyUtS@lnP8B "JavaScript (Node.js) – Try It Online")
---
Alternative that might not be supported by some browsers because of `at(-1)` (**62 bytes**) :
```
s=>[...s].sort().map(c=>a+=a.at(-1)==c?c:`
`+c,a="")&&a.trim()
```
Try it:
```
f=s=>[...s].sort().map(c=>a+=a.at(-1)==c?c:`
`+c,a="")&&a.trim()
;[
  `Ah, abracadabra!`,
  `\\o/\\o/\\o/`,
  `A man, a plan, a canal: Panama!`,
  `"Show me how you do that trick, the one that makes me scream" she said`
].forEach(s=>console.log(f(s)))
```
---
Alternative funny solution (**67 bytes**) :
```
s=>[...s].sort().map(a=c=>c!=' '?a[c]=[a[c]]+c:0)&&Object.values(a)
```
[Try it online!](https://tio.run/##NY@xbsMwDET3fAWTIZFQV@2cQikydG6Bjo4BM7RcO5FEQ1JS9OtdCUYG8hHHu@EueMdIYZzSs@fOzL2eoz7USqnYqMghCakcTgI16QOt9Q5271hTo@uymyfav8rt9vN8MZTUHe3NRIFyfqtXAO1xqADPAQm7gnVbFfV04pfHLMoRHPpshckuJPRo9/CV4R6xzffAv@AMFPzxDTqGNGCCFEa6Vvk2wN4smsOricWcuxl0G4j5G3Hs2lWjeg4fSIPIRYl9ZGuU5R/RiyilnP8B "JavaScript (Node.js) – Try It Online")
[Answer]
# [K (ngn/k)](https://codeberg.org/ngn/k), ~~11~~ 10 bytes
-1 byte from @doug's improvement
```
{.x" "_=x}
```
[Try it online!](https://ngn.codeberg.page/k#eJylkstugzAQRff+ionVRSpBXKmbBtRF/iBSlknUOMYEBMYUO4UoSr+99jhpHpsuegEdgx+6d4Y8OU4GCvTjfTgRYpPj0/Lw3SU5AAzpRlfpeJPzsk6H9JB2z+sTsUs6KyLg244LnnmMKIFxRGcOENEiIPKg3AtH2y2i68K0CMgCRvR57Q9erTS7PP5Q98ELd2qtkYwxvxrQCCjeOC/Q1oGCN7xOYO6g7nxRpa6Gfk01TjiIomCkxbe6vjOZBMxvvKJZuih0D0qCx0HvIdNgC27BdqWoIjeWoBsZvileSeMXG9FJrlYUjJs2vMxCUHeF8xdooUBdgp+j9/05yjmMDAr7DgF7nMmwsNSiHjoRWkDLEiEwJK2qm7ZFNFTFOGFaRgprW5MwJnQmd7rOJ8ZyUclBFLzZyYnQin3upbGlbgybvkzfXpkc2tqtzuKvUvaxzmMeG1eZZkfI4w9EfM/xJn+0lPyn6NeaE/IDwivNJg==)
Returns characters in order of appearance in original input.
* `=x` group the input, returning a dictionary mapping distinct values to the indices in which they appear in the input
* `" "_` remove the space character
* `.x` index back into the input using the indices returned above, and return just the values of the dictionary (i.e. the list of repeated characters)
[Answer]
# [Octave](https://www.gnu.org/software/octave/), 61 bytes
```
@(x)mat2cell(y=strtrim(sort(x)),1,diff(find([1 diff(+y) 1])))
```
This is an anoymous function that takes a string as input and outputs a cell arrray of strings.
[Try at Ideone](http://ideone.com/WoRneV).
### How it works
* `sort` sorts the input string. In particular, spaces will be at the beginning.
* `strtrim` removes leading spaces.
* `diff(+y)` computes consecutive differences between characters (to detect group boundaries)...
* ... so `diff(find([1 diff(+y) 1])` gives a vector of group sizes.
* `mat2cell` then splits the sorted string into chunks with those sizes.
[Answer]
# Processing, 109 bytes
```
void s(char[] x){x=sort(x);char l=0;for(char c:x){if(c!=l)println();if(c!=' '&&c!='\n'&&c!='\t')print(c);l=c;}}
```
Its the brute force approach, sort the array, then loop through it. If it doesn't match the last character printed, print a newline first. If it is whitespace, skip the printing step.
[Answer]
# Javascript (using external Library - Enumerable) (~~78~~ 67 bytes)
```
 n=>_.From(n).Where(y=>y!=' ').GroupBy(x=>x).WriteLine(y=>y.Write())
```
Link to lib: <https://github.com/mvegh1/Enumerable>
Code explanation: This is what Enumerable was made to do! Load the string into the library, which converts it to a char array. Filter out the white space entries. Group by char. Write each group to a line, according to the specified predicate. That predicate says to join all the elements of the current group into a string, without a delimiter.
[![enter image description here](https://i.stack.imgur.com/QGLlE.png)](https://i.stack.imgur.com/QGLlE.png)
[Answer]
## Bash + coreutils, ~~53~~ ~~50~~ 45 bytes
```
sed 's: ::g;s:\(.\)\1*:& :g'<<<`fold -1|sort`
```
There is no separator between the characters of a group and the groups are separated by space. There is one trailing group separator, but as I understood that's acceptable.
**Run:**
```
./explode_view.sh <<< '\o /\ o /\ o k'
```
**Output:**
```
// \\\ k ooo 
```
]