473,699 Members | 2,270 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

splitting strings

hey all,
i have the following string value:

xx__field_name_ _0__0

is it possible to split the string using the double underscores?

thanks,
rodchar
Nov 29 '07 #1
3 1137
arrVal = "xx__field_name __0__0".split(" __") or something of this nature
should work.

Regards,

Trevor Benedict
MCSD
"rodchar" <ro*****@discus sions.microsoft .comwrote in message
news:E4******** *************** ***********@mic rosoft.com...
hey all,
i have the following string value:

xx__field_name_ _0__0

is it possible to split the string using the double underscores?

thanks,
rodchar

Nov 29 '07 #2
Hi There,

Of course you can, two ways from top of my head:

string str = "xx__field_name __0__0";
string[] result1 = str.Split(
new string[] { "__" }, StringSplitOpti ons.RemoveEmpty Entries);

string[] result2 = System.Text.Reg ularExpressions .Regex.Split(st r, "__");

Hope this helps
--
Milosz
"rodchar" wrote:
hey all,
i have the following string value:

xx__field_name_ _0__0

is it possible to split the string using the double underscores?

thanks,
rodchar
Nov 29 '07 #3
thanks everyone for the quick response this helped.
rod.

"rodchar" wrote:
hey all,
i have the following string value:

xx__field_name_ _0__0

is it possible to split the string using the double underscores?

thanks,
rodchar
Nov 29 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
5353
by: Steven Bethard | last post by:
Here's what I'm doing: >>> lst = >>> splits = >>> for s in lst: .... pair = s.split(':') .... if len(pair) != 2: .... pair.append(None) .... splits.append(pair) ....
7
3202
by: Jeremy Sanders | last post by:
I have a large string containing lines of text separated by '\n'. I'm currently using text.splitlines(True) to break the text into lines, and I'm iterating over the resulting list. This is very slow (when using 400000 lines!). Other than dumping the string to a file, and reading it back using the file iterator, is there a way to quickly iterate over the lines? I tried using newpos=text.find('\n', pos), and returning the chopped text...
4
1835
by: sbucking | last post by:
im trying to split a string with this form (the string is from a japanese dictionary file with mulitple definitions in english for each japanese word) str1 / (def1, ...) (1) def2 / def3 / .... (2) def4/ def5 ... / the varibles i need are str*, def*.
3
1669
by: Aaron Walker | last post by:
I have a feeling this going to end up being something so stupid, but right now I'm confused as hell. I'm trying to code a function, that given a string and a delimiter char, returns a vector of the sub-strings. Here's what I have (I've thrown a main() in there for this mail). --- #include <iostream> #include <string>
2
1510
by: John Perks and Sarah Mount | last post by:
I have to split some identifiers that are casedLikeThis into their component words. In this instance I can safely use to represent uppercase, but what pattern should I use if I wanted it to work more generally? I can envisage walking the string testing the unicodedata.category of each char, but is there a regex'y way to denote "uppercase"? Thanks John
1
1393
by: madrobmegee | last post by:
I am wondering if any one knows how to split/parse a string of text up at special defined characters, such as a comma. As I need to split it into arrays to be displayed on a form.
6
2894
by: chezz | last post by:
Hey i looked at some earlier discussions on this topic and they seem a bit complex i found this code example on another site - char str = "200.0.0.90-200.0.0.223"; char *first = strtok(str, "-"); char *second = strtok(NULL, "\0");
4
1305
by: pkj7461 | last post by:
I want to split a string based on a pattern. my string is something like this. 10/8/2007 5:03:06 PM thakurab *************RECIVED MAIL FROM MIKE FOR THE PQR AND DPS CRETION*********************** PQR Start Time: 10/08/07 16:29:09 New PQR State: Assigned Respond Due Date: 10/09/07 00:29:09 Resolve Due Date: 10/10/07 16:29:09 Resolved On: 10/8/2007 5:23:40 PM pandeyra usually, there is date/time in the start of sentence...
4
1637
by: Eyes Of Madness | last post by:
I'm doing a program for a class of mine and I am having trouble splitting my strings up. I know you can do something like: a = '012345' a returns 012 but I am inputing strings of varying length and I cant just do the above notation. I need to split the string into groups of 3 in order to work. Any help would be much appreciated.
0
8631
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9055
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8945
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7787
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6550
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5889
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4392
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3075
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2366
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.