{"id":443,"date":"2020-04-27T13:33:24","date_gmt":"2020-04-27T12:33:24","guid":{"rendered":"https:\/\/ibex.tech\/csharp\/?p=443"},"modified":"2025-03-28T16:29:11","modified_gmt":"2025-03-28T16:29:11","slug":"using-strings-searching-strings","status":"publish","type":"post","link":"https:\/\/ibex.tech\/csharp\/c-sharp\/strings\/using-strings-searching-strings","title":{"rendered":"Using Strings-Searching Strings"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Does string start with?<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\tif (!string.IsNullOrEmpty(MyString) &amp;&amp; MyString.TrimStart().StartsWith(\"&lt;\"))\n\t{\n\t}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Does string contain?<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\tif (PageObject.Name.Contains(\"SomeTextString\"))\n\t{\n\t}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">If string ends with a comma remove it<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\tif (ValuesString.EndsWith(\",\"))\n\t\tValuesString = ValuesString.TrimEnd(',');<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Does string start with? Does string contain? If string ends with a comma remove it<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-443","post","type-post","status-publish","format-standard","hentry","category-strings"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/443","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/comments?post=443"}],"version-history":[{"count":3,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/443\/revisions"}],"predecessor-version":[{"id":1377,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/443\/revisions\/1377"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/media?parent=443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/categories?post=443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/tags?post=443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}