{"id":13383,"date":"2020-07-27T13:33:59","date_gmt":"2020-07-27T20:33:59","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=13383"},"modified":"2023-12-01T03:56:13","modified_gmt":"2023-12-01T11:56:13","slug":"java-string-replace","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/java-string-replace\/","title":{"rendered":"Java String replace() Method: A Step-By-Step Guide"},"content":{"rendered":"\n<p><em>The Java string <code>replace()<\/code> method will replace a character or substring with another character or string. The syntax for the <code>replace()<\/code> method is <code>string_name.replace(old_string, new_string)<\/code> with old_string being the substring you\u2019d like to replace and new_string being the substring that will take its place.<\/em><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>When you\u2019re working with a string in Java, you may encounter a situation where you want to replace a specific character in that string with another character. For instance, if you are creating a username generation program, you may want to replace certain letters with other characters to give a user a more random username.<br><\/p>\n\n\n\n<p>That\u2019s where the String replace() method comes in. The Java replace() method is used to replace all occurrences of a particular character or substring in a string with another character or substring.<br><\/p>\n\n\n\n<p>This tutorial will discuss how to use the String replace() method in Java and walk through an example of the method being used in a program.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Java Strings<\/h2>\n\n\n\n<p>Strings are used to store text-based data in programming. Strings can contain letters, numbers, symbols, and whitespaces, and can consist of zero or more characters.<br><\/p>\n\n\n\n<p>In Java, strings are declared as a sequence of characters enclosed within double quotes. Here\u2019s an example of a Java string:<br><\/p>\n\n\n\n<p><code>String bread = \u201cSeeded\u201d;<br><\/code><\/p>\n\n\n\n<p>In this example, we have assigned the string value <code>Seeded<\/code> to a variable called <code>bread<\/code>.<br><\/p>\n\n\n\n<p>Strings are a useful data type because they allow developers to interact with text-based data that can be manipulated. Strings can be reversed, replaced, and otherwise changed using the string methods offered by Java.<br><\/p>\n\n\n\n<p>When you\u2019re working with a string, you may decide that you want to change a specific character in the string to another character. We can use the replace() method to perform such a change.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Java String replace<\/h2>\n\n\n\n<p>The Java string replace() method is used to replace all instances of a particular character or set of characters in a string with a replacement string. So, the method could be used to replace every <code>s<\/code> with a <code>d<\/code> in a string, or every \u201c<code>pop<\/code>\u201d with \u201c<code>pup<\/code>\u201d.<br><\/p>\n\n\n\n<p>The syntax for the Java string replace() method is as follows:<br><\/p>\n\n\n\n<p><code>string_name.replace(old_string, new_string);<br><\/code><\/p>\n\n\n\n<p>The replace() method takes in two <strong>required<\/strong> parameters:<br><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>old_char<\/strong> is the character or substring you want to replace with a new character or substring.<\/li><li><strong>new_char<\/strong> is the character or substring with which you want to replace all instances of <code>old_char<\/code>.<\/li><\/ul>\n\n\n\n<p>Now, replace() will replace every instance of a character or substring with a new character or substring and return a new string. So, if you only want to change one specific character in a string, the replace() method should not be used.<br><\/p>\n\n\n\n<p>Additionally, replace() does not change the original string. Instead, the method returns a copy of the string with the replaced values. replace() is also case sensitive.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">String replace Examples<\/h2>\n\n\n\n<p>Let\u2019s walk through a few examples of the replace() method in action.<br><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Replace Substring<\/h3>\n\n\n\n<p>Suppose we are building an app for a restaurant that stores the names and prices of various sandwiches on the menu. The chef has informed us that he wants to update the name of the <code>Ham<\/code> sandwich to <code>Ham Deluxe<\/code> to reflect the fact that new ingredients have been added to the sandwich. We could make this change using the following code:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>Aclass ReplaceSandwiches {\n\tpublic static void main(String[] args) {\n\t\tString ham_entry = &quot;Ham: $3.00.&quot;;\n\t\tString new_ham_entry = ham_entry.replace(&quot;Ham&quot;, &quot;Ham Deluxe&quot;);\n\t\tSystem.out.println(new_ham_entry);\n\t}\n}\n<\/pre><\/div>\n\n\n\n<p>Our code returns the following:<br><\/p>\n\n\n\n<p><code>Ham Deluxe: $3.00.<br><\/code><\/p>\n\n\n\n<p>Let\u2019s break down our code. Firstly we define a class called ReplaceSandwiches, which stores the code for our program. Then we declare a variable called <code>ham_entry<\/code> which stores the name of the ham sandwich and its price.<br><\/p>\n\n\n\n<p>On the next line, we use the replace() method to replace the word <code>Ham<\/code> with <code>Ham Deluxe<\/code> in the<code> ham_entry<\/code> string. The result of the replace() method is assigned to the variable <code>new_ham_entry<\/code>. Finally, our program prints the contents of <code>new_ham_entry<\/code> to the console.<br><\/p>\n\n\n\n<p>Now we have the updated record for the ham sandwich.<br><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Replace Character<\/h3>\n\n\n\n<p>Additionally, the replace() method can be used to replace an individual character with another character. For instance, suppose we misspelled the word <code>Ham<\/code> in our string. Instead of appearing as <code>Ham<\/code>, we typed in <code>Hom<\/code>. We know there is only one <code>o<\/code> in our string, and we want to replace it with an <code>a<\/code>.<br><\/p>\n\n\n\n<p>We could use the following code to correct our mistake:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>class FixSandwich {\n\tpublic static void main(String[] args) {\n\t\tString ham_entry = &quot;Hom Deluxe: $3.00.&quot;;\n\t\tString new_ham_entry = ham_entry.replace(&quot;o&quot;, &quot;a&quot;);\n\t\tSystem.out.println(new_ham_entry);\n\t}\n}\n<\/pre><\/div>\n\n\n\n<p>Our code returns:<br><\/p>\n\n\n\n<p><code>Ham Deluxe: $3.00.&nbsp;<br><\/code><\/p>\n\n\n\n<p>Our code works in the same way as our first example, but instead of replacing a substring of characters, we instead replace an individual character. In this case, we replaced <code>o<\/code> with <code>a<\/code>.<br><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Replace Multiple Instances<\/h3>\n\n\n\n<p>The replace() method will replace every instance of a character or substring with a new character or substring. In the above examples, we only replaced one instance of a substring and a character because there was only one instance in our string. But if multiple instances of a character or substring were present, they would all be replaced.<br><\/p>\n\n\n\n<p>Suppose we have a string that stores the text that will appear on the banner, notifying customers that the restaurant with which we are working has a new menu. The banner appears as follows:<br><\/p>\n\n\n\n<p><code>\u201cMENU | Come see the new menu! | MENU\u201d<br><\/code><\/p>\n\n\n\n<p>The restaurant owner has decided he wants to replace the word \u201cMENU\u201d with his restaurant\u2019s name, <code>Sal\u2019s Kitchen<\/code>. We could do this using the following code:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>class ChangeBanner {\n\tpublic static void main(String[] args) {\n\t\tString old_banner = &quot;MENU | Come see the new menu! | MENU&quot;;\n\t\tString new_banner = ham_entry.replace(&quot;MENU&quot;, &quot;Sal's Kitchen&quot;);\n\t\tSystem.out.println(new_banner);\n\t}\n}\n<\/pre><\/div>\n\n\n\n<p>Our code returns:<br><\/p>\n\n\n\n<p><code>Sal\u2019s Kitchen | Come see the new menu! | Sal\u2019s Kitchen<br><\/code><\/p>\n\n\n\n<p>Our code works in the same way as our previous examples. However, because our initial string includes the word <code>MENU<\/code> twice, the replace() method replaces both instances. It\u2019s worth noting that the lowercase word <code>menu<\/code> appears in our string too, but because replace() is case sensitive, it is not replaced.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The <code>replace()<\/code> method is used in Java to replace every instance of a particular character or substring with another character or substring.<br><\/p>\n\n\n\n<p>This tutorial discussed how to use <code>replace()<\/code> to replace individual characters, substrings, and multiple instances of a character or a substring. We also explored a few step-by-step examples of the <code>replace()<\/code> method in action.<br><\/p>\n\n\n\n<p>You\u2019re now equipped with the information you need to replace the contents of a string using <code>replace()<\/code> in a Java program like a pro!<\/p>\n","protected":false},"excerpt":{"rendered":"The Java string replace() method will replace a character or substring with another character or string. The syntax for the replace() method is string_name.replace(old_string, new_string) with old_string being the substring you\u2019d like to replace and new_string being the substring that will take its place. When you\u2019re working with a string in Java, you may encounter&hellip;","protected":false},"author":240,"featured_media":13384,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[17289],"tags":[],"class_list":{"0":"post-13383","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-java"},"acf":{"post_sub_title":"","sprint_id":"","query_class":"Java","school_sft":"","parent_sft":"","school_privacy_policy":"","has_review":null,"is_sponser_post":"","is_guest_post":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.0 (Yoast SEO v27.0) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Java String replace() Method: A Step-By-Step Guide | Career Karma<\/title>\n<meta name=\"description\" content=\"We use the string replace() method to replace a character or substring with another character or substring. Learn how to use it in this article.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/careerkarma.com\/blog\/java-string-replace\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java String replace() Method: A Step-By-Step Guide\" \/>\n<meta property=\"og:description\" content=\"We use the string replace() method to replace a character or substring with another character or substring. Learn how to use it in this article.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/java-string-replace\/\" \/>\n<meta property=\"og:site_name\" content=\"Career Karma\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/careerkarmaapp\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-27T20:33:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T11:56:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/woman-drinking-coffee-during-daylight-3762806.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"667\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"James Gallagher\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@career_karma\" \/>\n<meta name=\"twitter:site\" content=\"@career_karma\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"James Gallagher\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/careerkarma.com\/blog\/java-string-replace\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-string-replace\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"Java String replace() Method: A Step-By-Step Guide\",\"datePublished\":\"2020-07-27T20:33:59+00:00\",\"dateModified\":\"2023-12-01T11:56:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-string-replace\/\"},\"wordCount\":974,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-string-replace\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/woman-drinking-coffee-during-daylight-3762806.jpg\",\"articleSection\":[\"Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/java-string-replace\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/java-string-replace\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/java-string-replace\/\",\"name\":\"Java String replace() Method: A Step-By-Step Guide | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-string-replace\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-string-replace\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/woman-drinking-coffee-during-daylight-3762806.jpg\",\"datePublished\":\"2020-07-27T20:33:59+00:00\",\"dateModified\":\"2023-12-01T11:56:13+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"We use the string replace() method to replace a character or substring with another character or substring. Learn how to use it in this article.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/java-string-replace\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/java-string-replace\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/java-string-replace\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/woman-drinking-coffee-during-daylight-3762806.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/woman-drinking-coffee-during-daylight-3762806.jpg\",\"width\":1000,\"height\":667},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/java-string-replace\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\/\/careerkarma.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\/\/careerkarma.com\/blog\/java\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Java String replace() Method: A Step-By-Step Guide\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\",\"url\":\"https:\/\/careerkarma.com\/blog\/\",\"name\":\"Career Karma\",\"description\":\"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/careerkarma.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\",\"name\":\"James Gallagher\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"caption\":\"James Gallagher\"},\"description\":\"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.\",\"url\":\"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Java String replace() Method: A Step-By-Step Guide | Career Karma","description":"We use the string replace() method to replace a character or substring with another character or substring. Learn how to use it in this article.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/careerkarma.com\/blog\/java-string-replace\/","og_locale":"en_US","og_type":"article","og_title":"Java String replace() Method: A Step-By-Step Guide","og_description":"We use the string replace() method to replace a character or substring with another character or substring. Learn how to use it in this article.","og_url":"https:\/\/careerkarma.com\/blog\/java-string-replace\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-07-27T20:33:59+00:00","article_modified_time":"2023-12-01T11:56:13+00:00","og_image":[{"width":1000,"height":667,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/woman-drinking-coffee-during-daylight-3762806.jpg","type":"image\/jpeg"}],"author":"James Gallagher","twitter_card":"summary_large_image","twitter_creator":"@career_karma","twitter_site":"@career_karma","twitter_misc":{"Written by":"James Gallagher","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/java-string-replace\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/java-string-replace\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"Java String replace() Method: A Step-By-Step Guide","datePublished":"2020-07-27T20:33:59+00:00","dateModified":"2023-12-01T11:56:13+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/java-string-replace\/"},"wordCount":974,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/java-string-replace\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/woman-drinking-coffee-during-daylight-3762806.jpg","articleSection":["Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/java-string-replace\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/java-string-replace\/","url":"https:\/\/careerkarma.com\/blog\/java-string-replace\/","name":"Java String replace() Method: A Step-By-Step Guide | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/java-string-replace\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/java-string-replace\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/woman-drinking-coffee-during-daylight-3762806.jpg","datePublished":"2020-07-27T20:33:59+00:00","dateModified":"2023-12-01T11:56:13+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"We use the string replace() method to replace a character or substring with another character or substring. Learn how to use it in this article.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/java-string-replace\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/java-string-replace\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/java-string-replace\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/woman-drinking-coffee-during-daylight-3762806.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/woman-drinking-coffee-during-daylight-3762806.jpg","width":1000,"height":667},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/java-string-replace\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/careerkarma.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/careerkarma.com\/blog\/java\/"},{"@type":"ListItem","position":3,"name":"Java String replace() Method: A Step-By-Step Guide"}]},{"@type":"WebSite","@id":"https:\/\/careerkarma.com\/blog\/#website","url":"https:\/\/careerkarma.com\/blog\/","name":"Career Karma","description":"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/careerkarma.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94","name":"James Gallagher","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","caption":"James Gallagher"},"description":"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.","url":"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/"}]}},"_links":{"self":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/13383","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/users\/240"}],"replies":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/comments?post=13383"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/13383\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/13384"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=13383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=13383"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=13383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}