Answer the question
In order to leave comments, you need to log in
Trying to capitalize the last letter, how?
I'm trying to capitalize the last letter in a string.
Here's what happened at the moment.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace evilbeck
{
class Program
{
static void Main(string[] args)
{
string file = @"2.txt";
Console.WriteLine();
Console.WriteLine($"Ваш файл: {file}");
Console.WriteLine();
string[] readfile = File.ReadAllLines(file);
foreach (string s in readfile)
{
var tmp = file.ToCharArray();
var last = tmp[tmp.Length - 1];
file = file.Remove(file.Length - 1) + last.ToString().ToUpper();
Console.WriteLine(file);
}
Console.ReadLine();
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question