Text String Snippets


Convert a string of text and ad hyperlinks to all the URLs. We loop through each URL and add a hyperlink

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

08 June, 2013   

Checks if the given encoding supports all the characters in the given string

Several hundred user notes on the str_replace page later, and we have a function that provides a variety of text highlighting options for plaintext or HTML strings.

05 August, 2014   

PHP code example to highlight words in a string.

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

Truncate or limit a text string while still preserving any HTML tags present. The code auto-closes the tags.

C++ source code for Output console text with type-writer effect

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....

07 April, 2013   

Search a body of text for the most common words

04 May, 2013   

How to read text file and print its contents to the console line by line.

Source code for KMP String Search Algorithm

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.

04 May, 2013   

C++ code example shown here how to write to text file.

Visual Basic code for inverting text with simple code. Very easy for all beginners. Easy to understand. Compatibility: VB 6 Author of the code: Ben - Ezrah Mansilla Declarations: Add two text box with default name One command with default name

Assigns the contents of a "url" to the string variable "result".

19 April, 2015   

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

19 December, 2012   

Example shown here how to convert String to Date in Java

19 April, 2016   

A simple method that generates a MD5 hash from a given string. It should be compatible with PHP's md5() function (just lowercase the string).

13 November, 2018   

Checks if the given string contains only valid ASCII characters. Returns True if so or False otherwise.