-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Clarify String.Contains #4250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify String.Contains #4250
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4105,7 +4105,13 @@ Examples of instantiating strings: | |
<summary>Returns a value indicating whether a specified character occurs within this string.</summary> | ||
<returns> | ||
<see langword="true" /> if the <paramref name="value" /> parameter occurs within this string; otherwise, <see langword="false" />.</returns> | ||
<remarks>To be added.</remarks> | ||
<remarks> | ||
<format type="text/markdown"><![CDATA[ | ||
|
||
## Remarks | ||
This method performs an ordinal (case-sensitive and culture-insensitive) comparison. | ||
]]></format> | ||
</remarks> | ||
</Docs> | ||
</Member> | ||
<Member MemberName="Contains"> | ||
|
@@ -4160,7 +4166,7 @@ Examples of instantiating strings: | |
## Remarks | ||
This method performs an ordinal (case-sensitive and culture-insensitive) comparison. The search begins at the first character position of this string and continues through the last character position. | ||
|
||
To determine whether a string contains a specified substring by using something other than ordinal comparison (such as culture-sensitive comparison, or ordinal case-insensitive comparison), you can create a custom method. The following example illustrates one such approach. It defines a <xref:System.String> extension method that includes a <xref:System.StringComparison> parameter and indicates whether a string contains a substring when using the specified form of string comparison. | ||
**.NET Framework only**: To determine whether a string contains a specified substring by using something other than ordinal comparison (such as culture-sensitive comparison, or ordinal case-insensitive comparison), you can create a custom method. The following example illustrates one such approach. It defines a <xref:System.String> extension method that includes a <xref:System.StringComparison> parameter and indicates whether a string contains a substring when using the specified form of string comparison. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does writing .NET Framework only at the beginning make it seem like the ability exists only in .NET Framework and not in .NET core(when it actually does)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure, I just copied this pattern. I defer to docs folks. |
||
|
||
[!code-csharp[System.String.Contains#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/System.String.Contains/cs/ContainsExt1.cs#1)] | ||
[!code-vb[System.String.Contains#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/System.String.Contains/vb/ContainsExt1.vb#1)] | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that remarks don't show in intellisense. If we want this to show up in VS, we should move this change up into the summary. I'm happy with the text itself though :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just copying
Contains (string value)
. @BillWagner ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BillWagner could you help with that question?