How to split a sting with comma and put into an array - EasyLanguage Programming | futures.io
futures.io futures trading


How to split a sting with comma and put into an array
Started: by huzisg Views / Replies:183 / 4
Last Reply: Attachments:0

Welcome to futures.io.

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.


You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

-- Big Mike

Reply
 
Thread Tools Search this Thread
 

How to split a sting with comma and put into an array

  #1 (permalink)
Trading Apprentice
HANGZHOU,ZHEJIANG,CHINA
 
Futures Experience: Advanced
Platform: Multicharts
Favorite Futures: MC
 
Posts: 5 since Aug 2016
Thanks: 0 given, 0 received

How to split a sting with comma and put into an array

HI, does anyone know how to split a string with comma to an array?

e.g.

str = "111,222,333,444,555"

arr[0] = "111";
arr[1] = "222";
...

thanks!

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
 Vendor: abctradinggroup.com 
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,185 since Apr 2013
Thanks: 198 given, 678 received


huzisg,

you should be able to accomplish that with using a while loop and the reserved words for string manipulation i.e.
LeftStr, RightStr, MidStr and InStr is what you can utilize here.
With these you can step through your string from comma to comma.

1. Have your loop check that there are still letters in your test string.
2. Take everything to the left of the first comma and store it in the array.
3. If there is no comma in the string, store the string in the array and set the test string to an empty string (so your loop can be exited).
4. Modify your test string so it now contains only the string to the right of the first comma.
5. You loop will repeat steps 2. to 4. until there is no new comma.

This should give you what you are looking for, but it will involve a bit of programming.

Regards,

ABCTG

Reply With Quote
 
  #4 (permalink)
Trading Apprentice
HANGZHOU,ZHEJIANG,CHINA
 
Futures Experience: Advanced
Platform: Multicharts
Favorite Futures: MC
 
Posts: 5 since Aug 2016
Thanks: 0 given, 0 received

So I known that there is no a function like "split" in vb, thanks for you reply.

Reply With Quote
 
  #5 (permalink)
 Vendor: abctradinggroup.com 
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,185 since Apr 2013
Thanks: 198 given, 678 received

Futures Edge on FIO
No, unfortunately there isn't, but you should be able to easily accomplish what you have in mind following the four simple steps I described.

Regards,

ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:

Reply



futures.io > > > > > How to split a sting with comma and put into an array

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

2016 True Edge Awards: Voting is open until Jan 21!

Now
 

An Afternoon with FIO member Massive l

Elite only
 

Anthony Drager: Pulling the trigger with confidence

Elite only
 

Leo Murphy: The Art and Science of Technical Analysis

Elite only
 

FuturesTrader71: Ask Me Anything

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
6E with 4 or 5 digits after the comma bart007 Currency Futures 19 January 15th, 2016 11:39 AM
Buyer Beware: Will Your Bond Fund Sting You? Quick Summary News and Current Events 0 December 13th, 2012 07:50 PM
Would-be Jihadist Chicago teenager tries to blow up bar, arrested in FBI sting kbit News and Current Events 0 September 16th, 2012 11:58 AM
here's way to convert tick data from NT to comma-separated format, with Mac or Linux theorist Platforms and Indicators 1 July 1st, 2012 05:00 AM
Why Sanctions Against Iran Might Sting More This Time* Quick Summary News and Current Events 0 December 28th, 2011 06:50 PM


All times are GMT -4. The time now is 12:49 AM.

no new posts
Page generated 2017-01-18 in 0.09 seconds with 19 queries on phoenix via your IP 54.163.149.151