2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

生&死=?

Posted at

https://gist.github.com/2212589 のc#版。もっと短くかけないかな?

lifedetah.cs
using System;
using System.Linq;
using System.Text;

namespace ConsoleApplication
{
    class Program
    {
        static void Main(string[] args)
        {
            var life = Encoding.UTF8.GetBytes("生");
            var death = Encoding.UTF8.GetBytes("死");
            var x = life.Select((b, i) => (byte)(b & death[i])).ToArray();
            Console.WriteLine(Encoding.UTF8.GetString(x));
        }
    }
}
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?