📄 startsends.cs
字号:
using System;
class clsStartsEnds
{
static void Main()
{
string Office1 = "Houston, Texas 77479";
string Office2 = "Las Vegas, Nevada 85023";
if (Office1.StartsWith("Houston"))
Console.WriteLine("{0} starts with Houston", Office1);
else
Console.WriteLine("{0} does not start with Houston", Office1);
if (Office2.StartsWith("Houston"))
Console.WriteLine("{0} starts with Houston", Office2);
else
Console.WriteLine("{0} does not start with Houston", Office2);
if (Office1.EndsWith("85023"))
Console.WriteLine("{0} ends with 85023", Office1);
else
Console.WriteLine("{0} does not end with 85023", Office1);
if (Office2.EndsWith("85023"))
Console.WriteLine("{0} ends with 85023", Office2);
else
Console.WriteLine("{0} does not end with 85023", Office2);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -