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 PostYes, it is ok. the problem is how to display just one letter "u" or "U"? thank for your time
Interesting that you are answering a quoted phrase that doesn't exist now and his post doesn't show as edited.
Since his replaced text fully answers your question, you should …
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.