split

VB.Net Split A Group Of Text

I am looking to split up multiple lines of text to single them out, for example: Url/Host:ftp://server.com/1 Login:Admin1 Password:Password1 Url/Host:ftp://server.com/2 Login:Admin2 Password:Password2 Url/Host:ftp://server.com/3 Login:Admin3 Password:Password3 How can I split each section into a different textbox, so tha...

How can I limit Perl's split function?

I have trying this: $string ="Group: ALL:ALL:Good"; @str2 = split (/:/,':',2); print "@str2"; I am looking in $str[0] = Group and $str[1]= ALL:ALL:Good. It not working. What would be issue? ...

.split("1px") into ["1px",1,"px"] in Javascript

I'm rubbish at Regular Expressions, really! What I'd like is to split a string containing a CSS property value into an array of [string,value,unit]. For example: if I supplied the .split() method with 1px it'd return ["1px",1,"px"]. If I were to supply, similarly, 10% it'd return ["10%",10,"%"]. Can this be done? I appreciate all you...

SQL Split function.

Hi guys, I'm looking for a way to do this ... SELECT FirstName, LastName, Split(AddressBlock, ' ', 1), Split(AddressBlock, ' ', 2), PostCode FROM Contacts The arguments I want to pass are ... The address The separator (current situation requires 2 spaces but this might be a comma or a space followed by a comma) or something els...

Linq-To-Sql equivalent for this sql query...

I thus far used concatenated Id string like 1,2,3 and updated in my table using this query... if exists( select ClientId from Clients where ClientId IN (SELECT i.items FROM dbo.Splitfn(@Id,',') AS i)) begin update Clients set IsDeleted=1 where ClientId IN (SELECT i.items FROM dbo.Splitfn(@Id,',') AS i) select 'delete...

Split string once in javascript?

How can I split a string only once, i.e. make 1|Ceci n'est pas une pipe: | Oui parse to: ["1", "Ceci n'est pas une pipe: | Oui"]? The limit in split doesn't seem to help... ...

Split command across lines

In Linux shell, one can split a command across several lines using \. For example: cmd \ arg1 \ arg2 How can I do the same using Windows console? Thanks! ...

string splitting based on char number

string data = "0000062456" how to split this string on 5 pieces so that I have: part[0] = "00"; part[1] = "00"; part[2] = "06"; part[3] = "24"; part[4] = "56"; ...

Split NSData objects into other NSData objects with a given size

I'm having an NSData object of approximately 1000kb big. Now I want to transfer this via bluetooth. This would be better if I have let's say 10 objects of 100kb. It comes to mind that I should use the -subdataWithRange: method of NSData. I haven't really worked with NSRange. Well I know how it works, but then to read from a given locati...

How can I split a string in Java?

Imagine I have this string: string thing = "sergio|tapia|gutierrez|21|Boston"; In C# I could go: string[] Words = thing.Split('|'); Is there something similar in Java? I could use Substring and indexOf methods but it is horribly convoluted. I don't want that. ...

Regex split string but keep separators

I'd like to do a Regex.Split on some separators but I'd like to keep the separators. To give an example of what I'm trying: "abc[s1]def[s2][s3]ghi" --> "abc", "[s1]", "def", "[s2]", "[s3]", "ghi" The regular expression I've come up with is new Regex("\\[|\\]|\\]\\["). However, this gives me the following: "abc[s1]def[s2][s3]ghi" --> ...

how to cut string with two regular expression "_" and "."

hello , i have a string like this test_1.doc and i want to split this string to have 1.doc ...

javascript - Google Chrome cluttering Array generated from .split()

Given the following string: var str = "one,two,three"; If I split the string on the commas, I normally get an array, as expected: var arr = str.split(/\s*,\s*/); Trouble is that in Google Chrome (for Mac), it appends extra properties to the array. Output from Chrome's debugger: arr: Array 0: one 1: two 2: three co...

NSString: fastes way of splitting

Hey, my question is a performance question. I need to split a huge NSString into coordinates. The string has this format: @"coordx,coordy coordx,coordy coordx,coordy (...)" My method to parse this is: -(NSMutableArray*) parsePath:(NSString*) pathString { // first split between the coordinates NSArray* path = [pathString com...

Split string with zsh as in Python

In python: s = '1::3' a = s.split(':') print a[0] # '1' good print a[1] # '' good print a[2] # '3' good How can I achieve the same effect with zsh? The following attempt fails: s="1::3" a=(${(s/:/)s}) echo $a[1] # 1 echo $a[2] # 3 ?? I want an empty string, as in Python ...

How to split line at non-printing ascii character in Python

How can I split a line in Python at a non-printing ascii character (such as the long minus sign hex 0x97 , Octal 227)? I won't need the character itself. The information after it will be saved as a variable. ...

Regex to split a string (in Java) so that spaces are preserved?

I need to split a string (in Java) into individual words ... but I need to preserve spaces. An example of the text I need to split is something like this: ABC . . . . DEF . . . . GHI I need to see "ABC", " . . . .", "DEF", ". . . .", and "GHI". Obviously splitting on the space character \s isn't going to work, as all the spaces g...

Extract from string in Java

I have a string; String value = "(5+5) + ((5+8 + (85*4))+524)"; How can I split/extract logical values from this string inside parenthesis as; (85*4) as one (5+8 + one) as two (two+524) as three ((5+5) + three) as four ... Any idea? all is welcome ...

Java Split not working as expected

I am trying to use a simple split to break up the following string: 00-00000 My expression is: ^([0-9][0-9])(-)([0-9])([0-9])([0-9])([0-9])([0-9]) And my usage is: String s = "00-00000"; String pattern = "^([0-9][0-9])(-)([0-9])([0-9])([0-9])([0-9])([0-9])"; String[] parts = s.split(pattern); If I play around with the Pattern and ...

XSLT: Regular Expression function does not work?

Ok, this one has been driving me up the wall... I have a xslt function that is supposed to split out the Zip-code part from a Zip+City string depending on the country. I cannot get it to work! This is what I got so far: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exslt="http://exslt.org/functi...