{"id":404,"date":"2019-11-04T09:34:14","date_gmt":"2019-11-04T16:34:14","guid":{"rendered":"https:\/\/www.great-white-software.com\/blog\/?p=404"},"modified":"2019-11-19T09:49:10","modified_gmt":"2019-11-19T16:49:10","slug":"moving-to-2019r2","status":"publish","type":"post","link":"https:\/\/www.great-white-software.com\/blog\/2019\/11\/04\/moving-to-2019r2\/","title":{"rendered":"Moving to 2019r2"},"content":{"rendered":"\n<p>2019r2 changes a LOT of things.<\/p>\n\n\n\n<p>Some of the things it changed are subtle and search and replace may NOT be the best approach to updating these.<\/p>\n\n\n\n<p>For instance string method like Mid changed from being a 1 based offset for the starting position to a 0 based offset.<\/p>\n\n\n\n<p>If all you do is change <em>mid<\/em> to <em>middle<\/em> you will inadvertently cause an off by one error because the start is now 0 based not 1 based.<\/p>\n\n\n\n<p>For instance<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>var foo as string = \"1234\"\nvar midString as string = foo.mid(2,2)\nvar middleString as string = foo.middle(2,2)<\/code><\/pre>\n\n\n\n<p>will give you different results in <em>midString<\/em> and <em>middleString<\/em>.<\/p>\n\n\n\n<p>There are many other places where the offsets have changed from 1 based to 0 based so be careful updating your code. Make sure you examine all the parameters being used as well to avoid causing yourself a lot of extra work trying to hunt down those off by one errors.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>2019r2 changes a LOT of things. Some of the things it changed are subtle and search and replace may NOT be the best approach to updating these. For instance string method like Mid changed from being a 1 based offset for the starting position to a 0 based offset. If all you do is change &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.great-white-software.com\/blog\/2019\/11\/04\/moving-to-2019r2\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Moving to 2019r2&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[6],"class_list":["post-404","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-tips"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/404","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/comments?post=404"}],"version-history":[{"count":1,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/404\/revisions"}],"predecessor-version":[{"id":405,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/404\/revisions\/405"}],"wp:attachment":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/media?parent=404"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/categories?post=404"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/tags?post=404"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}