Tags » Substring

Splitting a string & looping through results using subString&lastIndexof functions in Java

Substring: java string substring () method returns a part of the string.

Lastindex of: java string lastIndexOf () method returns the last index of the given character value or substring. 104 more words

Coding

Shuffle characters of a string in SQL Server

For security related reasons or for puzzle related circumstances, we may need to shuffle characters in a string. Here I am describing about how to do that in SQL Server. 311 more words

Technology

#R language#字符串

取子串

substr(x, start, stop)从字符串x中取出从第start个到第stop个的子串, 如

substr('JAN07', 1, 3)
## [1] "JAN"

如果x是一个字符型向量,substr将对每个元素取子串。如

substr(c('JAN07', 'MAR66'), 1, 3)
## [1] "JAN" "MAR"

substring… 210 more words

R Language

[C Language] How to extract substring between two words

/**********************************************************
   srcs: source string
   Dest: destination of string
   froms: firt word to match
   Tos: second word to match
   return: 1 successufull otherwise error
***********************************************************/

int extractContent(char *srcs, char* Dest ,char* froms,char* Tos)
{
	int iret;
	char *resultS;
	char *resultE;
	int len;
	int lentoken;
	iret=0;
	lentoken=strlen(Tos);
	resultS=strstr(srcs,froms);
	Dest[0]=0;
	if(resultS!=NULL)//first string found
	{
        resultS=resultS+strlen(froms);
		resultE=strstr(resultS,Tos);
		if(resultE!=NULL)//second string found
		{
			len=resultE-resultS
			strncpy(Dest,resultS,len);
			Dest=0;
			iret=1;
		}

	}

	return iret;
}

… 113 more words
C Language

Transact-SQL to Powershell: Substring

In my ongoing attempt to learn Powershell to help automate my workloads, I’ve come across the need to use the Transact-SQL SUBSTRING() function but, in using it, I got the following error: 404 more words

Powershell

Substring

#Split Column
for(i in 1:nrow(data)){
if(!is.na(as.numeric(substring(data$Description[i],first = 0, last = 1)))){

desc = data$Description[i]
pattern = “(PKT|KG|BOT|CTN|NOS)”
pattern2 = ” ”

data$Quantity[i]=substring(desc, first = 0, last = regexpr(pattern, desc)-1) 24 more words