# Manage Trash So

It's become somewhat of a tradition in PPCG that some users temporarily change their names by an anagram (a new name formed by reordering the letters of the old).

Sometimes it gets difficult to find out who is who. I could use a program or function to tell if two phrases are anagrams of each other.

### The challenge

The program or function should take two strings and produce a truthy result if they are anagrams of each other, and falsy otherwise.

### Rules

• Input will only contain letters (ASCII 65 to 90 and 97 to 122), digits (ASCII 48 to 57) or space (ASCII 32).
• The anagram relation is independendent of case. So "Arm" and "RAM" are anagrams.
• Spaces don't count either. So "keyboard" and "Barked Yo" are anagrams
• All builtins allowed
• Input format is flexible (two strings, an array of two strings, a string containing both phrases with a suitable separator ...)

Code golf. Fewest bytes wins.

### Test cases

Truthy:

Lynn, Nyl N
Digital Trauma, Tau Digital Arm
Sp3000, P S 3000
Manage Trash So, Those anagrams


Falsy

Calvins Hobbies, Helka Homba
Android, rains odd
In between days, bayed entwine
Code golf, cod elf got

• Related but different (only letters, no case, no spaces) – Luis Mendo Feb 25 '16 at 16:09
• This question's title is very perplexing to someone who's not had enough coffee. +1 :D – cat Feb 25 '16 at 17:36
• @DonMuesli I would argue that this is still a dupe. The slight changes are very trivial. – Mego Feb 25 '16 at 17:59
• Manage Trash So, Those anagrams. Nice. – mbomb007 Feb 25 '16 at 20:13
• So, the anagrams... – Leaky Nun May 21 '16 at 17:23

# Factor, 68 bytes

[ [ 32 swap remove >lower natural-sort ] map duplicates length 1 = ]


An anyonymous function. Call it like { "array" "of" "strings" } ~quotation~ call.

# D, 9910710310299131116 117 bytes

Edit: forgot about Dre case insensitivity imports lambdas

I don't like this language :D

import std.string,std.algorithm;(string[]a)=>sort(split(strip(a[0].toLower),""))==sort(split(strip(a[1].toLower),""))


To use it, assign it:

import std.string,std.algorithm;

void main () {
auto x = (string[]a) => sort(split(strip(a[0].toLower),"")) == sort(split(strip(a[1].toLower),""))
}

• Did you forget a ) at the end of your lambda? – Zacharý Nov 8 '16 at 20:55
• Can strip(a[0].toLower) be replaced by a[0].toLower.strip, likewise with a[1]? – Zacharý Nov 8 '16 at 21:03
• @ZacharyT Probably, yes – cat Nov 8 '16 at 21:37