The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
CBClay Burch Syncfusion Team May 19, 2002 06:18 AM UTC
You can use the static System.Int64.Parse method to convert a string to a signed 8-byte integer. In general, all the numeric types have this static Parse method.
string s = "12345678";
long x = Int64.Parse(s);
More generally, you can also use the System.Convert class to handle conversion among types.
MMMukesh MotwaniMay 19, 2002 10:06 AM UTC
System.Convert.ToInt64 works fine if there are no spaces. If I have a string like "128 128" and if the number of white spaces is not known using the code below in C, we can easily find the numeric variables.
/*C code*/
char string="128 128",*ptr;
NO_COL=strtol(string,&ptr,0);
NO_ROW=atoi(ptr);
The string is scanned up to the first
character inconsistent with the base. Leading "white-space" characters are ignored.
If the value of ptr is not (char **)NULL, a pointer to the character terminating the scan is returned in the location pointed to by ptr.
Is there an equivalent function in C# which will tells us the index in the string where the first character inconsistent with the base is returned using the different Formating Types provided by C#.
Thanks
Mukesh
> You can use the static System.Int64.Parse method to convert a string to a signed 8-byte integer. In general, all the numeric types have this static Parse method.
>
> string s = "12345678";
>
> long x = Int64.Parse(s);
>
> More generally, you can also use the System.Convert class to handle conversion among types.
>
>
CBClay Burch Syncfusion Team May 19, 2002 07:11 PM UTC
If your whitespace is really spaces, then you could strip them out with code such as this.
string s = "123 45678";
long x = Int64.Parse(s.Replace(" ", ""));