在 C# 中用 *(星号)符号包围 variable/parameter 的目的是什么?
What is the purpose of surrounding a variable/parameter with * (Star) symbols in C#?
中看到了这行代码
TokenId = *tokenId*,
和...
StripeCard stripeCard = cardService.Create(*customerId*, myCard);
但我以前从未见过被 *(星号)包围的 variable/parameter。这有什么特别的吗?这是.NET 的东西吗? C# 东西?
谢谢大家!
I remember * and ** are used as args and kwargs in python, and as a pointer to a var (*) or pointer to a pointer to a var (**) in C.
它在 C# 中没有任何意义,所以我假设 Stripe 使用它来指示您应该将 tokenId
和 customerId
放在它们的位置。
他们想通过在 *.
例如
var requestOptions = new StripeRequestOptions();
requestOptions.ApiKey = *optional*; // this is not required unless you choose to pass the apikey on every service call
requestOptions.IdempotencyKey = "some string"; // this is for Idempotent Requests - https://stripe.com/docs/api?lang=curl#idempotent_requests
requestOptions.StripeConnectAccountId = "acct_*" // if you are using Stripe Connect and want to issue a request on the connected account
他们只希望您可以用“选项”替换有效值
TokenId = *tokenId*,
和...
StripeCard stripeCard = cardService.Create(*customerId*, myCard);
但我以前从未见过被 *(星号)包围的 variable/parameter。这有什么特别的吗?这是.NET 的东西吗? C# 东西?
谢谢大家!
I remember * and ** are used as args and kwargs in python, and as a pointer to a var (*) or pointer to a pointer to a var (**) in C.
它在 C# 中没有任何意义,所以我假设 Stripe 使用它来指示您应该将 tokenId
和 customerId
放在它们的位置。
他们想通过在 *.
例如
var requestOptions = new StripeRequestOptions();
requestOptions.ApiKey = *optional*; // this is not required unless you choose to pass the apikey on every service call
requestOptions.IdempotencyKey = "some string"; // this is for Idempotent Requests - https://stripe.com/docs/api?lang=curl#idempotent_requests
requestOptions.StripeConnectAccountId = "acct_*" // if you are using Stripe Connect and want to issue a request on the connected account
他们只希望您可以用“选项”替换有效值