Howdy,
I have a byte array in memory, read from a file. I would like to split the byte array at a certain point(index) without having to just create a new byte array and copy each byte at a time, increasing the in memory foot print of the operation. What I would like is something like this:
byte[] largeBytes = [1,2,3,4,5,6,7,8,9];
...
Learning to program, trying to do this
I have a string like this
2+24*48/32
and I want to split it into a list like this
['2', '+', '24', '*', '48', '/', '32']
I have messed around with .split() but that's messy as it returns a list, which means I would now have to iterate over two strings, etc
...
Is there a function in Python to split a string without ignoring the spaces in the resulting list?
E.g:
s="This is the string I want to split".split()
gives me
>>> s
['This', 'is', 'the', 'string', 'I', 'want', 'to', 'split']
I want something like
['This',' ','is',' ', 'the',' ','string', ' ', .....]
...
Is there a function in python to split a word into a list of single letters? e.g
s="Word to Split"
to get
wordlist=['W','o','r','d','','t','o' ....]
...
How would one write a regular expression to use in python to split paragraphs?
A paragraph is defined by 2 linebreaks (\n). But one can have any ammount of spaces/tabs together with the line breaks, and it still should be considered as a paragraph.
I am using python so the solution can use python's regular expression syntax which is ex...
I need to be able to take a string like:
'''foo, bar, "one, two", three four'''
into:
['foo', 'bar', 'one, two', 'three four']
I have an feeling (with hints from #python) that the solution is going to involve the shlex module.
...
I have a string in a node and I'd like to split the string on '?' and return the last item in the array.
For example, in the block below:
<a>
<xsl:attribute name="href">
/newpage.aspx?<xsl:value-of select="someNode"/>
</xsl:attribute>
Link text
</a>
I'd like to split the someNode value.
Edit:
Here's the VB.Net t...
Hi, I need to upsize a split Access database, i.e., one that's currently split between tow mdb files, a front-end and back-end. I see many webpages that in essence say, "run the Upsizing Wizard." My first, very basic question:
Should I be running this wizard in my front-end mdb or my back-end mdb?
I assume I don't want to link main mdb...
I have a string that looks like this:
"Name1=Value1;Name2=Value2;Name3=Value3"
Is there a built-in class/function in Python that will take that string and construct a dictionary, as though I had done this:
dict = {
"Name1": "Value1",
"Name2": "Value2",
"Name3": "Value3"
}
I have looked through the modules available but ...
Suppose I have following string:
String asd = "this is test ass this is test"
and I want to split the string using "ass" character sequence.
I used:
asd.split("ass");
It doesn't work. What do I need to do?
...
I have a string which is like this:
this is [bracket test] "and quotes test "
I'm trying to write something in Python to split it up by space while ignoring spaces within square braces and quotes. The result I'm looking for is:
['this','is','bracket test','and quotes test ']
...
What's the most elegant way to split a string in C++? The string can be assumed to be composed of words separated by whitespace.
(Note that I'm not interested in C string functions or that kind of character manipulation/access. Also, please give precedence to elegance over efficiency in your answer.)
The best solution I have right now ...
Before few days I was at some IT conference here in Belgrade. On Agenda was a topic about MySql, and clustering in MySql, and the guys from MySql said that they have the best solution for cluster split brain problem, does anyone know something about this, is this true or just a marketing trick?
...
ok so basically I am asking the question of their name
I want this to be one input rather than Forename and Surname.
Now is there any way of splitting this name? and taking just the last word from the "Sentence" e.g.
name = "Thomas Winter"
print name.split()
and what would be output is just "Winter"
...
So I'm using python to do some parsing of web pages and I want to split the full web address into two parts. Say I have the address http://www.stackoverflow.com/questions/ask. I would need the protocol and domain (e.g. http://www.stackoverflow.com) and the path (e.g. /questions/ask). I figured this might be solved by some regex, however ...
Hi,
I've got text in a form of
[1/12/2008 2:32:11 p.m. - name]
line 1
[1/12/2008 2:36:00 p.m. - name] - PRIVATE
line 2 [some text] sd
[1/12/2008 2:36:00 p.m. - name]
line 3
which i want to split into items so i have access to time, name and text of each item,
e.g.:
(item 1)
1: 1/12/2008 2:32:11 p.m.
2: name
3: line 1
(item 2)...
I am sure this is very simple problem, but I am new to vb.net so am having an issue with it.
I have a Decimal variable and I need to split it into two seperate variables, one containing the integer part, and one containing the fractional part.
eg for x = 12.34 you would end up with a y = 12 and a z = 0.34
Are there any nice built in ...
Hello all. I'm new to regular expressions and would appreciate your help. I'm trying to put together an expression that will split the example string using all spaces that are not surrounded by single or double quotes. My last attempt looks like this: (?!") and isn't quite working. It's splitting on the space before the quote.
Exampl...
I'm trying to split a string up into words and punctuation, adding the punctuation to the list produced by the split.
For instance:
>>> c = "help, me"
>>> print c.split()
['help,', 'me']
What I really want the list to look like is:
['help', ',', 'me']
So, I want the string split at whitespace with the punctuation split from the wo...
I'd like to split a string using one or more separator characters.
E.g. "a b.c", split on " " and "." would give the list ["a", "b", "c"].
At the moment, I can't see anything in the standard library to do this, and my own attempts are a bit clumsy. E.g.
def my_split(string, split_chars):
if isinstance(string_L, basestring):
...