Tags » Substring

Extracting substrings with StringUtils from the Apache library

Following on from some of my earlier posts, where I described some of the useful utils from the apache.commons.lang3 library (like that very nice RandomStringUtils class), this time I will focus a bit on the StringUtils class.  1,828 more words

Testing

Convert a string into Title case in Sqlserver

Input: This is test input data!

output: This Is Test Input Data!

CREATE FUNCTION funTitleCase
(
@str VARCHAR(1000)
)
RETURNS VARCHAR(1000)
AS
BEGIN
DECLARE @counter INT = 0, @length INT = 0;

45 more words
Substring

Convert varchar to date

As you can see from the Snippet below, the date (nvarchar) is in US format; we want to convert this to UK format.

If you don’t want to convert it to a date, or you just want to convert it to a readable UK format, simply remove the… 137 more words

Convert Date Time

Formatting phone numbers without FORMAT

Today’s post is not an especially elegant solution, or even a flashy one. It’s not some big sexy piece of existentialist SQL poetry. But it is practical, and it was a fun little challenge.  243 more words

T-sql

JavaScript substring functions

Substring (indexstart[, indexend])

Returns part of a string between indexstart and indexend, but not including indexend.
Index (indexStart) of first character is 0.  189 more words

Javascript

All Palindromes in a string

Ever had to find if a string is a palindrome , perhaps in your college assignment , well i know the problem is too easy but how aboutwe raise the bar a bit ? 206 more words

Knuth-Morris-Pratt substring search

When searching for the pattern A A B A A A in the text A A B A A B A A A A, we first detect the mismatch at position 5, but we had better restart at position 3 to continue the search, since otherwise we would miss the match. 250 more words