473,513 Members | 2,428 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

2 String Questions

Hello,

I am having 2 problems related with strings:

1. I have a string as follows: "File01.xml,File02.xml,File03.xml"
I need to create an array where first item is "File01.xml", second
item is "File02.xml", etc.

2. When having string "File01.xml" I need to get "File01" by removing
".xml"

Could someone help me out with this?

Thanks,
Miguel

Nov 3 '06 #1
1 1005
Hi Miguel,

First, I'll answer your questions, then point you to some resources to help
you in the future.
1. I have a string as follows: "File01.xml,File02.xml,File03.xml"
I need to create an array where first item is "File01.xml", second
item is "File02.xml", etc.
string s = "File01.xml,File02.xml,File03.xml";
string[] fileNames = s.Split(',');

http://msdn2.microsoft.com/en-us/lib...em.string.aspx
2. When having string "File01.xml" I need to get "File01" by removing
".xml"
String s = "File01.xml";
String trimmed = System.IO.Path.GetFileNameWithoutExtension(s);

http://msdn2.microsoft.com/en-us/lib...m.io.path.aspx

--
HTH,

Kevin Spencer
Microsoft MVP
Ministry of Software Development
http://unclechutney.blogspot.com

I just flew in from Chicago with
a man with a wooden leg named Smith
who shot an elephant in my pajamas.
So I bit him.
"shapper" <md*****@gmail.comwrote in message
news:11*********************@k70g2000cwa.googlegro ups.com...
Hello,

I am having 2 problems related with strings:

1. I have a string as follows: "File01.xml,File02.xml,File03.xml"
I need to create an array where first item is "File01.xml", second
item is "File02.xml", etc.

2. When having string "File01.xml" I need to get "File01" by removing
".xml"

Could someone help me out with this?

Thanks,
Miguel

Nov 3 '06 #2

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

Similar topics

3
1855
by: Robert | last post by:
Hello, Can anyone help with this code? I need to split a long piece of text from a textarea box into small chunks, then POST these chunks to my credit-card provider, whereupon he will POST...
6
1900
by: lkrubner | last post by:
Last year I asked a bunch of questions about character encoding on this newsgroup. All the answers came down to using ord() in creative ways to try to make guesses about multi-byte characters. I...
0
1160
by: ani | last post by:
I have a questionaire page , which basically has questions with multiple choice answers. I need to accomplish paging on this and there are few questions that are gender specific. According the...
0
878
by: anu | last post by:
I have a questionaire page , which basically has questions with multiple choice answers. I need to accomplish paging on this and there are few questions that are gender specific. According the...
0
228
by: ani | last post by:
I have a questionaire page , which basically has questions with multiple choice answers. I need to accomplish paging on this and there are few questions that are gender specific. According the...
0
7260
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7384
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7537
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...
1
7099
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...
0
5685
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,...
0
4746
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...
0
3233
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...
0
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
799
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.