Answer the question
In order to leave comments, you need to log in
Is it possible in a c# console command to change the color of characters in a string?
Hello, I know that it is possible to change text color and color by text in the console.
Is it possible to change the background from black to another color.
And the main question.
There is a string
string stroka = "new sausage la la la.."; Can I change the color of only "la la" in this line, and leave everything else white? or I have only one way out - is to divide the string by certain characters and only then change the color of the line where this word is located?
Answer the question
In order to leave comments, you need to log in
As an option to set
img {
display: block;
margin: 0;
padding: 0;
}
Few info. What you posted means nothing. Maybe the image has an indent, or maybe something else.
I think that .portfolio-items should be wrapped in a container and given the following parameters:
<div class="container">
<div class="portfolio-items">
<div class="portfolio-item"><img src="img/portfolio-item-1.jpg" alt="#"></div>
<div class="portfolio-item"><img src="img/portfolio-item-2.jpg" alt="#"></div>
</div>
</div>
.container {
max-width: 1280px;
margin: 0 auto;
}
.portfolio-items{
display: flex;
margin: 0;
padding: 0;
transition: 0.3s ease-in-out;
}
If you need to paint the entire console with one color - use
Console.BackgroundColor = ConsoleColor.Green; // к примеру зеленый
Console.Clear();
Console.Write("новая колбаса ");
Console.ForegroundColor = ConsoleColor.Red;
Console.Write("ла ла ");
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("ла..");
Here is an example
Console.ForegroundColor = ConsoleColor.Red;
Console.BackgroundColor = ConsoleColor.Yellow;
Console.WriteLine("Вычисления c и s круга");
Console.WriteLine("");
Console.ForegroundColor = ConsoleColor.Yellow;
Console.BackgroundColor = ConsoleColor.Black;
Console.Write("Введите радиус > ");
double r = Convert.ToDouble(Console.ReadLine());
//длина окружности:
double c = 2 * Math.PI * r;
//площадь круга:
double s = Math.PI * r * r;
//округляем значения:
c = Math.Round(c, 2);
s = Math.Round(s, 2);
//печатаем результаты вычислений в консольном окне:
Console.ForegroundColor = ConsoleColor.Green;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question