[英]How SomeMethod('everyday 8:00',execute_mehotd) to pass time expression string to set up what time to execute
[英]Custom ReSharper pattern - using String.SomeMethod instead of string.SomeMethod
我知道C#中的string
和String
之間沒有區別(除了為System.String
添加的using System
之外)。 不過,同樣喜歡在這個所謂的答案 ,我寧願使用字符串以小寫s
類型和字符串以大寫S
的時候我叫String.SomeMethod(例如String.IsNullOrWhitespace(...)
; String.Format(...)
或String.Empty
。
string.$method$
Show as suggestion
Unchecked
Check if string.SomeMethod is used instead of String.SomeMethod
String.$method$
Checked
Unchecked
Use String instead of string
在類似string.IsNullOrWhitespace(...)
它確實給出了建議,並將其正確替換為String.IsNullOrWhitespace(...)
。 但是,問題在於,當它已經正確或在我替換它之后,它現在還會給出建議。 那么有可能使搜索模式區分大小寫嗎? 因此,它將僅在string.SomeMethod
處給出建議,而不是在String.SomeMethod
處給出建議?
編輯:此外,是否有可能將其應用於整個項目/解決方案,類似於警告Remove unused directives in file
-> Remove unused directives in solution
中的Remove unused directives in solution
(在v8.0或更高版本中)?
之所以會出現這種現象,是因為string
和String
相同,並且ReSharper經常在后台執行類型縮減。 SSR就是這樣的地方,其中進行了許多概括和可能的重新安排。 簡而言之,SSR專為語法更改而設計,您(有效地)在做的是執行純粹的符號更改,對於任何人而言,實際上都不會更改代碼。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.