-1

I want to extract part of a string within given limits in C language. I tried strcpy() but it only extracts the first n characters from a string.
How can I do this?

bc_wicki
  • 1
  • 1

1 Answers1

0

What you are looking for is Substring(). Here's a simple example:

string Str = "I only want to extract \"want\" from this string.";
string Str2 = Str.Substring(7, 4);
MessageBox.Show("String 1: " + Str +" - String 2: "+Str2);
  • Welcome to Stack Overflow. Please read the [About] page soon. Note that this question is tagged [tag:c] and not [tag:c#] or something similar. What you've provided is not using standard C notations. It might be C++, or some other language, but it isn't standard C. I recommend deleting this answer. In the future, be careful to note the tags and the question content (it does say 'C' explicitly), and make sure that your answers fit the questions appropriately. – Jonathan Leffler Feb 28 '15 at 19:42