I have an array(2 field array) which i want to Strip "/" off the first field and retrieve the remaining array With its same 2nd field value...
This is what i'm trying to do..
CurrencyPairs = new string[] { "EURUSD", "USDJPY", "GBPUSD", "EURGBP", "USDCHF", "AUDNZD", "CADCHF", "CHFJPY", "EURAUD", "EURCAD", "EURJPY", "EURCHF", "USDCAD", "AUDUSD", "GBPJPY", "AUDCAD", "AUDCHF", "AUDJPY", "EURNOK", "GBPCAD", "GBPCHF", "NZDJPY", "NZDUSD", "EURNZD", "USDNOK", "USDSEK", "XAUUSD", "XAGUSD", "XTIUSD", "XBRUSD" };
This Array Will be passed from a C# App to my Java App Which Will then create a Integer ID for the whole Strings...
Now, I want to Split the third String "EUR" "USD" into two and add "/" to it... Which Will look like this:
ReceivedPairs = new string[] { "EUR/USD", "USD/JPY", "GBP/USD", "EUR/GBP", "USD/CHF", "AUD/NZD", "CAD/CHF", "CHF/JPY", "EUR/AUD", "EUR/CAD", "EUR/JPY", "EUR/CHF", "USD/CAD", "AUD/USD", "GBP/JPY", "AUD/CAD", "AUD/CHF", "AUD/JPY", "EUR/NOK", "GBP/CAD", "GBP/CHF", "NZD/JPY", "NZD/USD", "EUR/NZD", "USD/NOK", "USD/SEK", "XAU/USD", "XAG/USD", "XTI/USD", "XBRUSD" };
And, the Java append a value to the Arrays by making it look this way..
func(String Pairs, int Id);
func("EURUSD",928);
Which One Pair Will always be attached to a Generated ID..
How do I Split the Pairs Into two? How do i Still make the values not leave the Array after the Splitting?
Thanks for your time taken..
EDIT: I have Tried currencyPairs.strip
, but that won't work as i have no value to strip in the Strings... There is no "/", no "-". Just Splitting By Substring Length is what i need.. I know that in C++, but here in Java... Missing