Skip to content

Instantly share code, notes, and snippets.

@mstoic
mstoic / reverse_a_string_using_string_builder
Created September 1, 2020 19:28
Reverse a String Using StringBuilder
StringBuilder str = new StringBuilder("Hey");
int len = str.length();
for (int i = 0; i < len; i++) {
str.append(str.substring(len - 1 - i, len - i));
}
str.delete(0, len);
System.out.println("string: " + str);
@mstoic
mstoic / Current_Page_URL.php
Created April 18, 2021 16:45
WordPress - Get The Current Page URL
global $wp;
$current_url = home_url(add_query_arg(array(),$wp->request));