Interview Practice 10 – Reverse Sentence

Simple task, reverse words in a sentence.

Read more...

Capitalizing Words in Javascript

This is a very old draft stuck at the bottom of my draft list. lol [sourcecode language=”javascript”] var str = "hello world"; str = str.toLowerCase().replace(/b[a-z]/g, function(letter) { return letter.toUpperCase(); }); alert(str); //Displays "Hello World" [/sourcecode] Making it as a function, we can do this. [sourcecode language=”javascript”] function capitalize(str) { return str.toLowerCase().replace(/b[a-z]/g, function(letter) { return letter.toUpperCase();…

Read more...

Posting source codes on WordPress

This is visual basic. [sourcecode language=”vb”] Private Function TempPath() As String Const MaxPathLen = 256 ‘Max length of the path, just as big as possible Dim FolderName As String ‘Name of the folder Dim ReturnVar As Long ‘Return Value End Function [/sourcecode] To do so, you need to wrap the code between [‌‌‌‌‌sourcecode language=”vb”] and…

Read more...