Skip to main content
added 149 characters in body
Source Link
Nahuel Fouilleul
  • 8.6k
  • 1
  • 10
  • 18

Bash, 78, 7676 71 bytes

for c in {B..a};{ [[ -n ${1// } ]]&&echo "$1";set "${1//[!$c-Z${c,}-z]/ }";}

Depending on collation (default LC_ALL) can save some more bytes

for c in {b..z} _;{ [[ -n ${1// } ]]&&echo "$1";set "${1//[!$c-Z]/ }";}

[Try It Online][1] [1]: https://tio.run/##Fcq9CsMgGEbhW3kj4lQTMru1Q9fMEQdrzQ8kCtouitf@Nd0OPOdl80a0xASHPaDe@942VaE1ZACv4zCgwRghvNsiGB@Zyv5zxZ90x52ceXW3Jou5TqYaEU0prsme5x5WTN9SDp8h8Ihvj2c8lu4H##Fcq9DoMgFIbhW/kkhE2NM2OHrs4lpFGKP4lyErALhGs/tdubPO88pY15oQiHPaDMXZcr3rrAGLQBsgx9jwprlfJuIwg5CJ38dcefTCNd@7L3InRl5jHSGqfz3MOK8Zvz4RMUHvTxeNKxND8

Bash, 78, 76 bytes

for c in {B..a};{ [[ -n ${1// } ]]&&echo "$1";set "${1//[!$c-Z${c,}-z]/ }";}

[Try It Online][1] [1]: https://tio.run/##Fcq9CsMgGEbhW3kj4lQTMru1Q9fMEQdrzQ8kCtouitf@Nd0OPOdl80a0xASHPaDe@942VaE1ZACv4zCgwRghvNsiGB@Zyv5zxZ90x52ceXW3Jou5TqYaEU0prsme5x5WTN9SDp8h8Ihvj2c8lu4H

Bash, 78, 76 71 bytes

for c in {B..a};{ [[ -n ${1// } ]]&&echo "$1";set "${1//[!$c-Z${c,}-z]/ }";}

Depending on collation (default LC_ALL) can save some more bytes

for c in {b..z} _;{ [[ -n ${1// } ]]&&echo "$1";set "${1//[!$c-Z]/ }";}

[Try It Online][1] [1]: https://tio.run/##Fcq9DoMgFIbhW/kkhE2NM2OHrs4lpFGKP4lyErALhGs/tdubPO88pY15oQiHPaDMXZcr3rrAGLQBsgx9jwprlfJuIwg5CJ38dcefTCNd@7L3InRl5jHSGqfz3MOK8Zvz4RMUHvTxeNKxND8

added 206 characters in body
Source Link
Nahuel Fouilleul
  • 8.6k
  • 1
  • 10
  • 18

Bash, 7878, 76 bytes

for c in {B..Za} _;;{ [[ -n ${1// } ]]&&echo "$1";set "${1//[!$c-Z${c,}-z]/ }";}

[Try It Online][1] [1]: https://tio.run/##Fcq9CsMgGEbhW3kj4lQTMru1Q9fMEQdrzQ8kCtouitf@Nd0OPOdl80a0xASHPaDe@942VaE1ZACv4zCgwRghvNsiGB@Zyv5zxZ90x52ceXW3Jou5TqYaEU0prsme5x5WTN9SDp8h8Ihvj2c8lu4H

Bash, 78 bytes

for c in {B..Z} _;{ [[ -n ${1// } ]]&&echo "$1";set "${1//[!$c-Z${c,}-z]/ }";}

Bash, 78, 76 bytes

for c in {B..a};{ [[ -n ${1// } ]]&&echo "$1";set "${1//[!$c-Z${c,}-z]/ }";}

[Try It Online][1] [1]: https://tio.run/##Fcq9CsMgGEbhW3kj4lQTMru1Q9fMEQdrzQ8kCtouitf@Nd0OPOdl80a0xASHPaDe@942VaE1ZACv4zCgwRghvNsiGB@Zyv5zxZ90x52ceXW3Jou5TqYaEU0prsme5x5WTN9SDp8h8Ihvj2c8lu4H

Source Link
Nahuel Fouilleul
  • 8.6k
  • 1
  • 10
  • 18

Bash, 78 bytes

for c in {B..Z} _;{ [[ -n ${1// } ]]&&echo "$1";set "${1//[!$c-Z${c,}-z]/ }";}