Solved

split string

Posted on 2014-03-12
1
283 Views
Last Modified: 2014-03-12
Hi there

Can someone show me a peice of code that can get me a value based on using C# split method?

When i get a value returned from DB the first part of the returned value is...

Transaction #

so the whole value is -    Transaction # 123456

and i just want the number 123456
0
Comment
Question by:razza_b
1 Comment
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 500 total points
ID: 39925453
string s = "Transaction # 123456";
// split the string on #
string[] sarray = s.Split('#');
// get 2nd part of the string
string newstring = sarray[1].Trim();
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to LOAD up a .NET Framework website with data? 2 42
ADO.NET ENTITY DATA MODEL 3 32
Error on link 14 40
Adding  DYMO Labelprinter to c# client application 4 11
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now