Navigation X
ALERT
Click here to register with a few steps and explore all our cool stuff we have to offer!



   909

Some Little Help

by OutCome - 04 October, 2020 - 08:20 PM
This post is by a banned member (OutCome) - Unhide
OutCome  
Supreme
474
Posts
293
Threads
5 Years of service
#1
need some help to fix this code 
 
Code:
 
using System;
using System.Runtime.CompilerServices;

public static class Helper2
{
#pragma warning disable CS1750 // A value of type 'int' cannot be used as a default parameter because there are no standard conversions to type 'StringComparison'
public static string Substring(this string @this, string from = null, string until = null, StringComparison comparison = 2)
#pragma warning restore CS1750 // A value of type 'int' cannot be used as a default parameter because there are no standard conversions to type 'StringComparison'
{
int length = (from ?? string.Empty).Length;
int num = (!string.IsNullOrEmpty(from) ? @this.IndexOf(from, comparison) + length : 0);
if (num < length)
{
throw new ArgumentException("from: Failed to find an instance of the first anchor");
}
int num2 = (!string.IsNullOrEmpty(until) ? @this.IndexOf(until, num, comparison) : @this.Length);
if (num2 < 0)
{
throw new ArgumentException("until: Failed to find an instance of the last anchor");
}
return @this.Substring(num, num2 - num);
}
}


when i try to build show me this error: https://prnt.sc/ut0lt7
This post is by a banned member (ebp) - Unhide

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
or
Sign in
Already have an account? Sign in here.


Forum Jump:


Users browsing this thread: 1 Guest(s)