Solved

split string

Posted on 2014-03-12
1
284 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Error in JQuery 5 53
Exit the loop 4 42
Media.Imaging 1 18
Need to start a web service from Visual Studio 2015 Pro 2 24
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

778 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