Find string at certain characters

<>

This question already has an answer here:

Answers


You can use TrimStart() function to Trim the all inital Zero's

Try This:

           String str1 = "00000000000000000000523";
           str1=str1.TrimStart('0');

If you are always going to remove the 0's from the start:

String s = "0000000005875784".TrimStart(new Char[] { '0' } );

Try this:

string oldValue = "00000000000000000000523";
string value = oldValue.TrimStart('0');

This will remove all leading 0s leaving you with the desired value.


Use a Dictionary dict. Each entry will be added to the dictionary with key = original string, value = Int.TryParse(originalString.TrimStart('0'), out parsedInt).

Then You can sort by the value easily.


First of All your question is not very clear but to my understanding you want to get values out by ignoring Zeros. This is what I would do:

use: .replace("0","");, and then use indexOf()


Need Your Help

PuTTY terminal freezes/lags with Vagrant Virtual Box

performance virtualbox vagrant putty lag

I'm using Vagrant on Virtual Box. The install scripts automatically set up PuTTY for ssh session with the environment. The thing is, it often is slow and lags. The session will freeze while I type ...

what's the diff between oracle “initialization parameters” and “session parameters”?

mysql oracle

in MySQL, we could you system variable and session variable, those var share the same name and also the some meaning, just one for instance and one only for session.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.