split

PHP - split a string of HTML attributes into an indexed array

Hi, I've got a string with HTML attributes: $attribs = ' id= "header " class = "foo bar" style ="background-color:#fff; color: red; "'; How to transform that string into an indexed array, like: array( 'id' => 'header', 'class' => array('foo', 'bar'), 'style' => array( 'background-color' => '#fff', 'color' => 'red' ...

PHP and RegEx: Split a string by commas that are not inside brackets (and also nested brackets)

Two days ago I started working on a code parser and I'm stuck. How can I split a string by commas that are not inside brackets, let me show you what I mean: I have this string to parse: one, two, three, (four, (five, six), (ten)), seven I would like to get this result: array( "one"; "two"; "three"; "(four, (five, six), (ten...

Can Mysql Split a column ?

I have a column that has comma separated data: 1,2,3 3,2,1 4,5,6 5,5,5 I'm trying to run a search that would query each value of the CSV string individually. 0<first<5 and 1<second<3 and 2<third<4 I get that I could return all queries and split it myself and compare it myself. I'm curious if there is a way to do this so mysql ...

Perl: Is there a way to split on the last regex match only?

Here's an interesting problem. Is it possible to split a string on the last matching regex only? Consider the following list of column headings from my data file (which read along the same line, being tab-separated): Frequency Min Frequency Avg Frequency Max Voltage L1 Min Voltage L1 Avg Voltage L1 Max Active Power L1 Min Active Power ...

How do i split $_SERVER['HTTP_REFERER'] to get the base url?

I have $_SERVER['HTTP_REFERER'], pretend it is http://example.com/i/like/turtles.html . What would i need to do to get just the "http://example.com" part out of the string and set into its own variable? ...

Splitting table cells in wordML programatically

how to Splitting table cells in wordML programatically ...

C# Split byte[] array

I am doing RSA encryption and I have to split my long string into small byte[] and encrypt them. I then combine the arrays and convert to string and write to a secure file. Then encryption creates byte[128] I use this the following to combine: public static byte[] Combine(params byte[][] arrays) { byte[] ret = new byte[arrays.Sum(...

How do I split an mp3 file into smaller files?

I want to make a program that takes an MP3 file and breaks it into many smaller mp3 files based on 1-2 seconds of no sound (silence). What is the easiest way to do this in c#? ...

Java: get last element after split

Hi there i am using the String split method and i want to have the last element. The size of the Array can change. examples : String one = "Düsseldorf - Zentrum - Günnewig Uebachs" String two = "Düsseldorf - Madison" i want to split this and get the last item : lastone = one.split("-")[here the last item] <- how? lasttwo = one.s...

How can I split horizontally across several vertically split windows in Vim?

Basically, I want to go from 1) to 2) I usually do this by splitting horizontally first and then vertically, but as I want this to do three-way diffs, it is much handier to start vim by running: $ vimdiff file1 file2 file3 And then doing something to open the split window below. 1) +----+----+----+ ¦ ¦ ¦ ¦ ¦ f1 ¦...

Array.Split() with square brackets[], from the Advanced Actionscript Animation book

I'm trying to understand how this piece of code from Keith Peter's Advanced Actionscript works. Essentially there's a for loop going on to split key/value pairs seperated by :. Here's the code: var definition:Object = new Object(); for(var i = 0;i < tokens.length; i++) { var key:String = tokens[i].split(":")[0]; var val:String...

How do I split a string into an array?

I want to split a string into an array. The string is as follows: :hello:mr.zoghal: I would like to split it as follows: hello mr.zoghal I tried ... string[] split = string.Split(new Char[] {':'}); and now I want to have: string something = hello ; string something1 = mr.zoghal; How can I accomplish this? ...

How can I split a string along a user-provided string separator in Perl?

My code used to work fine, and now it's breaking. A reduction of the problem is the following: I want to split a source string (from a database, but that's not important) at a separator. The separator is not fixed, but user provided, in a string. I used to do that: @results = split($splitString, $sourceStr); But this breaks when the u...

VBScript howto split a quoted delimited AND spaced separate values?

I have the following string: "C:\Program Files\Application\Path\executable.exe" -- "/flag" I am trying to split the string so that I get: array(0) = C:\Program Files\Application\Path\executable.exe I don't care about the rest of the array since I am just concerned about the file path not the args. ...

Stripping Uppercase Words in Excel VBA

Stripping Uppercase Words in Excel VBA I have an Excel sheet like this one: A B 1 Used CONTENT VERSION SYSTEM for the FALCON Project 2 USA beats UK at Soccer Cup 2008 3 DARPA NET’s biggest contribution was the internet 4 One big problem is STRUCTURED QUERY LANGUAGE queries on non-normalized data I ...

VB.NET split string with quotation marks in it

Trying to split a line wherever "," appears (with the quotation marks), The problem is VB.NET uses " to start/end strings, so I tried using .Split(""",""") but that then splits it by " not "," ...

string.split - by multiple character delimiter

i am having trouble splitting a string in c# with a delimiter of "][". For example the string "abc][rfd][5][,][." Should yield an array containing; abc rfd 5 , . But I cannot seem to get it to work, even if I try RegEx I cannot get a split on the delimiter. EDIT: Essentially I wanted to resolve this issue without the need for a Reg...

How can I combine Perl's split command with white space trimming?

Repost from Perlmonks for a coworker: I wrote a perl script to separate long lists of email separated by a semi colon. What I would like to do with the code is combine the split with the trimming of white space so I don't need two arrays. Is there away to trim while loading the first array. Output is a sorted list of names. Thanks. #!/...

Given Server Relative URL, quickest way to find the last thing (i.e. after final slash)

I'm assuming: String abc = "My Documents/FileName.txt".Split('/')[1]; // is not the quickest way Is it? ...

To switch from vertical split to horizontal split fast in Vim

How can you switch your to current windows from horizontal split to vertical split and vice versa in Vim? I did that a moment ago by accident but I cannot find the key again. ...