LoginSignup
0
0

More than 1 year has passed since last update.

c#演算式:【X?.x】.cs の用例

Posted at

image.png

c#演算式:【X?.x】.cs の用例

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

namespace Rextester
{
    public class SampleModel
    {
        public string id { get; set; }
    }
    public class Program
    {
        public static void Main(string[] args)
        {
            SampleModel sampleModel = null;
            Console.WriteLine("|" + sampleModel?.id + "|");
            try{
                if (string.IsNullOrWhiteSpace(sampleModel?.id))
                {
                    Console.WriteLine("1111");
                }
            } catch(Exception ex){
                    Console.WriteLine(ex);
            }
        }
    }
}

Onlineツール: https://rextester.com/

0
0
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
0
0