Tags » Substring

5 Longest Palindromic Substring

Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.

Transact SQL and the C Level Programmer ( String Casing and Indexes )

Background

Again, back reviewing code and saw yet another interesting one.

The code looks like this:


select username
from   .
where  LOWER(lastname) = LOWER(@lastname)

Thinking… 593 more words

Microsoft

Find index of last occurrence of a sub-string using SQL Server

-- Find Index from the String
select (LEN('0000000000000045') - CHARINDEX('0',Reverse('0000000000000045')) + 1) as FindIndex

-- Using Regx(if after the value is zero(0)
SELECT PATINDEX('%[^0]%','0000000000000450000')


-- Fetch Value except before Zero(0)
SELECT reverse(left(reverse('0000000000000045'), charindex('0', reverse('0000000000000045')) -1)) as FetchValueExceptZero



select REVERSE(SUBSTRING(REVERSE('000000000045'),0,CHARINDEX('0',REVERSE('000000000045')))) as FetchValueExceptZero

-- Using Regx(if after the value is zero(0)
select substring('0000000000000450000',patindex('%[^0]%','0000000000000450000'),Len('0000000000000450000'))
SQL Server

String tokenizer, split(), scanner performance comparison metrics in Java

Here are some metrics that I have gathered around tokenizer, split and scanner. These are various methods of splitting a string into array of individual string elements. 66 more words

General

MACRO TO PARSE STRING DATA WITH DELIMITERS

ABSTRACT

This is a macro to parse string data that have a specific type of delimiters. (In this example, the delimiter is the semi-colon “;”.) The macro is needed so that it can loop through all character variables each of which needs to be split into a number of new variables based on a predefined delimiter. 328 more words

Rosalind in F# - Finding a Motif in DNA

Finding a Motif in DNA is our next problem, exploring the definition of substring. This problem is exceedingly straight forward so we’ll just jump right in to it. 273 more words

Programming

[371/441] Hart of the matter

Once is an incident, twice is a co-incidence, and thrice is a pattern.  While I have been back at home, Mom brought out an old document that solidified a co-incidence into a pattern through a triangular argument. 253 more words

Postaday