Milan Spinka

Milan Spinka

  • NA
  • 1
  • 821

Use String.StartsWith(value) with incomplete value string

Aug 6 2015 12:45 PM
Hi all,
 
I would like to know how to use the bool String.StartsWith(string value) like this:
       
void Main()
{ 
      int random; //this is an int that will change randomly
      string _uStr = "The random int is currently " + random.ToString() + " and this is another text";
      
      if (_uStr.StartsWith ("The random int is currently something and this"))
      {
            //execute something
      } 
}
 
My question: Is there a way of replacing something to ignore several characters in the string?  

Answers (2)