string s1="Ui";
string s2="uk";
How can I compare them and print result just Uik or uik. not twice Uuik. my program understand such as different values(Uu). Is there any function or something like that? thank you a lot
kikiritce
0
Newbie Poster
Recommended Answers
Jump to PostHow about this?:
using System.Linq; namespace DW_411760_CS_CON { class Program { static void Main(string[] args) { string s1 = "Ui"; string s2 = "uk"; string s3 = new string((s1 + s2).ToLower().Distinct().ToArray()); } } }
Jump to PostI would do it sort of like this:
#pragma once using namespace System; using namespace System::Collections::Generic; using namespace System::Linq; namespace DW_411760_CPP_LIB { public ref class CProgram { public: static String^ MergeString(String^ s1, String^ s2) { String^ s3 = gcnew String( Enumerable::ToArray(Enumerable::Distinct((s1+s2)->ToLower()))); return s3; } }; }
...and …
Jump to PostIn order to make that work, you will need to change the C# project to the highest dot net level and add a new C++ project as a Class Library.
You will then need to add a refrence from inside the C# project to the C++ project, add the necessary …
All 10 Replies
thines01
401
Postaholic
Team Colleague
Featured Poster
kikiritce
0
Newbie Poster
kikiritce
0
Newbie Poster
thines01
401
Postaholic
Team Colleague
Featured Poster
ddanbe
commented:
Continuous efforts!
+15
thines01
401
Postaholic
Team Colleague
Featured Poster
thines01
401
Postaholic
Team Colleague
Featured Poster
kplcjl
17
Junior Poster
thines01
401
Postaholic
Team Colleague
Featured Poster
kplcjl
17
Junior Poster
thines01
401
Postaholic
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.