please answer the two questions using the direction on the top please
the direction is already at the top, we are using c#
Problem 1 :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Build
{
class Program
{
static void Main(string[] args)
{
string actualString = "Together";
string buildString;
buildString = actualString.Substring(5);
Console.WriteLine("Builded string is "+buildString );
Console.ReadKey();
}
}
}
Problem 2:
Output :
Code has errors.
1.. The name 'str' does not exist in the current
context Build
2.. cannot convert from 'int' to
'string' Build
After removing errors :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Build
{
class Program
{
static void Main(string[] args)
{
string str =
"together";
string str2 = str.Substring(5, 1).ToUpper() + str.Substring(6, 1) +
" ";
Console.WriteLine("First Output : "+str2);
str2 = str.Substring(2, 3);
str2 =
str.Insert(4,"")+"";
str2 = str.Substring(5,3);
Console.WriteLine("Second Output : " + str2);
Console.ReadKey();
}
}
}
please answer the two questions using the direction on the top please the direction is already...