String Function Snippets


11 October, 2011   

In the same way you often need to format data being sent from Flash, you sometimes need to format data being received. This function takes a string and removes all spaces from it. Here we use the split method of the String class to split the string into an Array and then call the join method of the Array class to convert it back to a string....

18 September, 2013   

If you don’t need human readable string, then use this function instead, which will create a random string you can use for user id’s etc.

04 February, 2013   

This removes every instance of a space in the given string returning the new string as a string for Visual Basic

19 April, 2015   

Merges two strings in a way that a pattern like ABABAB will be the result.

28 February, 2013   

This function takes a string and an output buffer and a desired width.

17 July, 2018   

This function takes a string and an output buffer and a desired width.

In Delphi, procedural types (method pointers) allow you to treat procedures and functions as values that can be assigned to variables or passed to other procedures and functions. Here's how to call a function (or procedure) as a parameter of another function (or procedure) : Declare the function (or procedure) that will be used as a...

11 July, 2011   

To do a Hello world proved to be quite simple, so lets take it a bit further and write a function which prints the hello world text.

Passing in a simple string of text converting it to lowercase and replacing all the spaces with a dash

Simple way to do the opposite of what the nl2br() function does- turns breaks () into new lines.

This function takes in two strings (value,key) and uses XOR encryption to encrypt (and decrypt) the value using the key. it returns the encrypted value as a C++ string. by John Shao

06 February, 2013   

Delphi code for String to Hexadecimal

13 March, 2011   

This code convert String to Hexadecimal

I was trying to pass an array through SWFObject flashvars and realized it can't be done. Instead you need to use a string for your array, pass it into Flash , then convert it to an array using the actionscript "split" function.

I was trying to pass an array through SWFObject flashvars and realized it can't be done. Instead you need to use a string for your array, pass it into Flash , then convert it to an array using the actionscript "split" function.

16 March, 2011   

This checks to see if two strings match each other.

This code will break a string of words up along the spaces and do a mySQL search for each of the words in the string.

This code will break a string of words up along the spaces and do a mySQL search for each of the words in the string.

13 March, 2014   

Delphi code example for [UNIT] ROT1 Encrypt Strings

Ever wondered how Visual Studio executes a process - such as a compiler - and displays the text it returns in its own window? It's actually really easy - and here's a simple example as to how.