C#中是否有python的as关键字

Sou*_*tem 2 c# python keyword

当我使用 python 时,
我可以使用 as 关键字替换库名

这是一个示例代码:

import matplotlib.pyplot as plt

plt.rc('font', family = 'Malgun Gothic')
plt.title("title")
plt.plot(a, label = 'maximum degree', color = 'cyan', linestyle=':', marker = 'v')
plt.legend()
plt.show()
Run Code Online (Sandbox Code Playgroud)

根据这段代码 matplotlib.pyplot 被 'as' 关键字替换为 plt

我想as在 C# 中使用这个关键字

  • C#中是否有python的as关键字

Mar*_*ell 5

在 C# 中,“使用别名”;ifmatplotlib.pyplot是完全限定的 .NET 类型:

using plt = matplotlib.pyplot;
Run Code Online (Sandbox Code Playgroud)