String compare
String compare
29 Mar 2015, 14:12
Hi,
How do i get a string compare that return the position of the characters in the string.
I just have to know if a symbol like "EURUSD" got the currency "USD" in it.
When i try :
Print(String.Compare(Symbol.Code, "EUR"));
it returns me "1" with EURUSD symbol chart, but it returns me the same result with GPBUSD chart... What am i doing wrong ? Thank you.
Replies
hq76
30 Mar 2015, 16:57
RE:
Invalid said:
Compare is used to check if strings are equal.
Use Contains method
Symbol.Code.Contains("EUR");
Thank you Invalid. But i still need to check if "EUR" is the base currency or not... I know that EUR are always the base currency in forex pairs though.. But i'll have to check the same way for "USD" for instance.
I would like to check if "USD" is the 1st currency in "USDJPY" or the second one in "GBPUSD".
@hq76
Invalid
30 Mar 2015, 15:13
Compare is used to check if strings are equal.
Use Contains method
@Invalid