Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have an array of string and I want to see if an element of it not contained in another string, so dont call the function named onefive in my code below input1 array of string while s1 string. the code works but my problem I dont want if (wo) is a substring from s1 but just if whole string for instance suppose that:

input1={info, text, car};
s1="information carrot";

the function (onefive) will not be called in first element info and the third element car because info is a substring from information and car is a substring from carrot but I dont want that!

please I need help but without using Regex because it dosent work in my language!

What I have tried:

foreach (string wo in input1)
            {
                if (!s1.Contains(wo))
                {
                    zo = zo+onefive(wo);
                    
                }
            }
Posted
Updated 30-Sep-17 17:21pm

1 solution

Then you should be looking for equality of strings, check this out: String.Equals[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900