在C#中,可以使用以下兩種方法來定義字符串:
string str1 = "Hello, World!";
string str2 = @"C:\Users\Public\Documents";
無論使用哪種方法,都可以定義一個字符串變量,并對其進行賦值。