3 edited body
source | link

Another perl:

$ str="abcdefgh"
$ perl -pe 'substr($_,2,1) ^= " "' <<<"$str"
abCdefgh
  • The general form is substr($_,n,1) where n is the position of letter you want to invert the case (0-based index).

  • When you xor an ACSIIASCII character with space, you invert its case.

Another perl:

$ str="abcdefgh"
$ perl -pe 'substr($_,2,1) ^= " "' <<<"$str"
abCdefgh
  • The general form is substr($_,n,1) where n is the position of letter you want to invert the case (0-based index).

  • When you xor an ACSII character with space, you invert its case.

Another perl:

$ str="abcdefgh"
$ perl -pe 'substr($_,2,1) ^= " "' <<<"$str"
abCdefgh
  • The general form is substr($_,n,1) where n is the position of letter you want to invert the case (0-based index).

  • When you xor an ASCII character with space, you invert its case.

2 added 16 characters in body
source | link

Another perl:

$ str="abcdefgh"
$ perl -pe 'substr($_,2,1) ^= " "' <<<"$str"
abCdefgh
  • The general form is substr($_,n,1) where n is the position of letter you want to invert the case (0-based index).

  • When you xor an ACSII character with space, you invert its case.

Another perl:

$ str="abcdefgh"
$ perl -pe 'substr($_,2,1) ^= " "' <<<"$str"
abCdefgh
  • The general form is substr($_,n,1) where n is the position of letter you want to invert the case.

  • When you xor an ACSII character with space, you invert its case.

Another perl:

$ str="abcdefgh"
$ perl -pe 'substr($_,2,1) ^= " "' <<<"$str"
abCdefgh
  • The general form is substr($_,n,1) where n is the position of letter you want to invert the case (0-based index).

  • When you xor an ACSII character with space, you invert its case.

1
source | link

Another perl:

$ str="abcdefgh"
$ perl -pe 'substr($_,2,1) ^= " "' <<<"$str"
abCdefgh
  • The general form is substr($_,n,1) where n is the position of letter you want to invert the case.

  • When you xor an ACSII character with space, you invert its case.