{"id":94,"date":"2022-09-15T20:10:31","date_gmt":"2022-09-15T20:10:31","guid":{"rendered":"https:\/\/mustafauzun.co\/blog\/?p=94"},"modified":"2022-09-15T20:10:31","modified_gmt":"2022-09-15T20:10:31","slug":"c-turn-the-datatable-to-string-based-calculator","status":"publish","type":"post","link":"https:\/\/mustafauzun.co\/blog\/c-turn-the-datatable-to-string-based-calculator\/","title":{"rendered":"C#, turn the DataTable to string based calculator"},"content":{"rendered":"\n<p>With C#, it&#8217;s pretty easy to do string-based math.<br><\/p>\n\n\n\n<p>The following method, you can quickly perform simple calculator or mathematical operations.<\/p>\n\n\n\n<p>(Source: <a href=\"https:\/\/gist.github.com\/mrna0\/9284c9638887cc420c0db6af43b819f5\" data-type=\"URL\" data-id=\"https:\/\/gist.github.com\/mrna0\/9284c9638887cc420c0db6af43b819f5\">My Gist<\/a>)<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-csharp\" data-lang=\"C#\"><code>var result = new System.Data.DataTable().Compute(&quot;12+4\/2&quot;, null);\nConsole.Write(result);<\/code><\/pre><\/div>\n\n\n\n<p>More: <a href=\"https:\/\/docs.microsoft.com\/tr-tr\/dotnet\/api\/system.data.datatable.compute?view=net-6.0\" data-type=\"URL\" data-id=\"https:\/\/docs.microsoft.com\/tr-tr\/dotnet\/api\/system.data.datatable.compute?view=net-6.0\">Microsoft Docs<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>With C#, it&#8217;s pretty easy to do string-based math. The following method, you can quickly perform simple calculator or mathematical operations. (Source: My Gist) More:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[26,22,27,24,25,23],"class_list":["post-94","post","type-post","status-publish","format-standard","hentry","category-c","tag-basic-calculator","tag-calculate","tag-simple-calculating","tag-simple-calculator","tag-string-calculate","tag-string-calculator"],"_links":{"self":[{"href":"https:\/\/mustafauzun.co\/blog\/wp-json\/wp\/v2\/posts\/94","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mustafauzun.co\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mustafauzun.co\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mustafauzun.co\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mustafauzun.co\/blog\/wp-json\/wp\/v2\/comments?post=94"}],"version-history":[{"count":2,"href":"https:\/\/mustafauzun.co\/blog\/wp-json\/wp\/v2\/posts\/94\/revisions"}],"predecessor-version":[{"id":96,"href":"https:\/\/mustafauzun.co\/blog\/wp-json\/wp\/v2\/posts\/94\/revisions\/96"}],"wp:attachment":[{"href":"https:\/\/mustafauzun.co\/blog\/wp-json\/wp\/v2\/media?parent=94"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mustafauzun.co\/blog\/wp-json\/wp\/v2\/categories?post=94"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mustafauzun.co\/blog\/wp-json\/wp\/v2\/tags?post=94"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}