码迷,mamicode.com
首页 > Windows程序 > 详细

Visual studio 2019 preview & C# 8 initial experience

时间:2018-12-14 22:42:29      阅读:247      评论:0      收藏:0      [点我收藏+]

标签:work   obj   img   fir   family   sys   target   studio   color   

Visual studio 2019 preview & C# 8 initial experience

技术分享图片

技术分享图片

?

技术分享图片

?

技术分享图片

?

using System;

using static System.Console;

namespace ConsoleApp2

{

class Program

{

static void Main(string[] args)

{

string s = null;

WriteLine(s.ToString());

WriteLine($"The first letter of {s} is {s[0]}");

}

}

}

技术分享图片

?

<Project Sdk="Microsoft.NET.Sdk">

?

<PropertyGroup>

<OutputType>Exe</OutputType>

<TargetFramework>netcoreapp3.0</TargetFramework>

<ApplicationIcon />

<StartupObject />

<AssemblyName>ConsoleApp1</AssemblyName>

<RootNamespace>ConsoleApp1</RootNamespace>

<LangVersion>8.0</LangVersion>

<NullableReferenceTypes>true</NullableReferenceTypes>

</PropertyGroup>

?

?

技术分享图片

?

技术分享图片

?

技术分享图片

?

using System;

using static System.Console;

namespace ConsoleApp2

{

class Program

{

static void Main(string[] args)

{

string? s = null;

?

WriteLine($"The first letter of {s}is {s?[0] ?? ‘?‘}");

}

}

}

?

Visual studio 2019 preview & C# 8 initial experience

标签:work   obj   img   fir   family   sys   target   studio   color   

原文地址:https://www.cnblogs.com/xiexiaokui/p/10121591.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!