Analysis of the separate value of the tube in the SQL server

I have a User_Role column in one of my table, which has pipe separated values like guest|user_Admin|user_guest user_Admin|guest guest|user_guest|user_Admin user_guest|user_Admin user_Admin I have to get the roles from the above column, which has Admi

Select multiple substrings from a multiline string

I'm attempting to create a PowerShell script to pick particular lines from large log files. Using Select-String, I've gotten the data down to just the rows I need in a multiline string. Now I'd like to further massage it to return only the ID numbers

Trim chain back to three specific characters

How can I trim some string until I got three specific characters which are the same as, for example, "xyz". To be precise I will give an example: Dim String1 as String = "GunsAndRosesWelcomeToTheJungle" Dim String2 as String = "Do

Unable to locate the Java substring in the for loop

I'm trying to make a calculator app and I have a string for the final equation inputted. "983+388+12" How I'm solving is by first identifying where the operator is. After this I loop backwards and forwards trying to find the 2 numbers and then I

How to use the substring with replace in a query?

Hi How can I add REPLACE to the following query? SELECT SUBSTRING(title,1,1) AS titlealpha, COUNT(title) FROM serien WHERE not_seen ='' GROUP BY titlealpha; From an alphabetical list, with titlealpha I try to replace extraordinary letters, like öäüéà

Substring containing words up to n characters

I've got a string and I want to get first words that are containing up to N characters together. For example: String s = "This is some text form which I want to get some first words"; Let's say that I want to get words up to 30 characters, resul

How to separate a string with an unknown length?

I'm writing a program that has different outputs depending on a name inputted by the user. The format of the output is decided by the first letter with the rest of the name being used throughout excluding the first letter. Essentially how do I make a

Powershell V2 - removes the last x characters from a string

I have a file containing a few thousand lines of text. I need to extract some data from it, but the data I need is always 57 characters from the left, and 37 characters from the end. The bit I need (in the middle) is of varying length. e.g. 20141126_

How to check a string starts with a substring or not in Java?

I want to check a string which starts with http:// or not. How can I do that without loop? Thanks in advance.use public boolean startsWith(String prefix) in String API eg : boolean isStartsWith = YOUR_STRING.startsWith("http://"); String tst = &

Perl Match Substring in a chain ignore spaces

I have a string $str = "xxxxxx Code File(s) Name:Some_thing.c CodeFile(s) Version:27 Design Document:some_other_design.doc Module Design Document Version:43 somexxxxxxxxxx Compiler Version:9.5 Doc Type:Word xxxxxx"; where xxxxx represents any ch

Separate the words after the last integer in a large string

I've seen many people do similar to this in order to get the last word of a String: String test = "This is a sentence"; String lastWord = test.substring(test.lastIndexOf(" ")+1); I would like to do similar but get the last few words af

Java - substring search in table

I am trying to find a subString inside a string, in an arraylist, but I can't get it working. It has to loop through the arraylist until it finds the sub string, and then stop. Here is what I have so far private static void teamSearch(String teamName

Replace characters at specific positions in strings in Oracle

I'm trying to write a function that can decode a message by switching pairs of characters around. Say I have the message hello! which, when encoded, turns into ehll!o. Is there an existing function in Oracle that lets me replace characters at specifi

How to find substring occurrences in a string

I would like to find a substring in a string in may occur many times it may be even look like: Search for: aba Line: ababa Result: 2 I forgot what methods I should use. String s = "ababa", key="aba"; int limit= s.length()-key.length(),

Can Perl replace multiple substrings with regex?

I have some substring [ aa bb cc ] in a line, like $line = "1 2 a b [ aa bb cc ] c d [ bb cc ] 3 4". And I want to trim all the spaces in these substrings. The following code does not work. while($line =~ /\[(.*?)\]g/) { $1 =~ s/\s+//g; } Can so

Java ArrayList String Separation

Here is my code: import java.util.ArrayList; public class SplitString { public static void main(String[] args) { String s = "80+5+3*(11%(3*2)-(5+1)+6)-(10+10)+(2*2)*5"; ArrayList<String> equation = new ArrayList<>(); String ns = &quo

SQL Server Substrate Buffer Padding

This is probably a simple question but I'm trying to create a new column in SQL server based off of 4 others. The idea is to create a customer ID based off the first 5 characters of Zip, Last name, first name, and address. My question is: how to I en

Merge two strings with common start and end substrings

I have two strings the ending substring of first is the starting substring of the second,ex string left : ONESTRING string right : STRINGTWO I have to merge them so that the resulting string is result string : ONESTRINGTWO The length of the common su

Text.remove for formatting the phone number in

I have a textbox for a phone number that formats the phone number to look like this: (123) 456-7891 but I want it to change back to just numbers when the user is finished with the data entry: 1234567891 Here's my code for formatting the number: Dim n

Replacing multiple XSLT strings with recursion

I have been attempting to perform multiple (different) string replacement with recursion and I have hit a roadblock. I have sucessfully gotten the first replacement to work, but the subsequent replacements never fire. I know this has to do with the r

UpperCase problem, using IndexOf

Enter a line of text. No punctuation please. Java is the language. I have rephrased that line to read: Is the language java. Attempt: int x; String sentence, first; System.out.println("\nEnter a line of text. No punctuation please."); Scanner ke