C
C
Chipu2018-10-15 16:18:45
C++ / C#
Chipu, 2018-10-15 16:18:45

C# How to remove a region of a line?

5bc4937b0bf90868093966.png
It is necessary to remove from string s = "ABC" letters starting from s[1] and ending with [3]. How to do it?
As far as I know, Substring does not seem to work here.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
#
#, 2018-10-15
@Chipu

helps String.Remove there is also an application example,
use Visual Studio or Visual Studio Code. type the name of the variable, put a dot - the list drops out, view it, most of the methods can be understood by name
use the F1 button on the names of classes and methods, it is very useful to scroll through the information about the class
and use Google .. otherwise asking questions here, you will learn the language for years . by the time of some kind of knowledge, it turns out that it is outdated

M
Maxim Isaev, 2018-10-15
@MaximIs

string.delete(from the first character by index, to the third). In sharpe like this:
s.remove(1,3);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question