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:231 / 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)
Elite Member
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,257 since Apr 2013
Thanks: 201 given, 707 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)
Elite Member
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,257 since Apr 2013
Thanks: 201 given, 707 received

Futures Edge on FIO

What value do you place on the webinars 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)

PTMC Protrader Platform First Look w/Sergey Sokolov

Elite only

Spring Grains Outlook w/Sean Lusk @ Walsh Trading

Elite only

FIO Video Journal Challenge featuring NinjaTrader ($2,000+ of prizes)

April

Process above all else w/Anthony Crudele @ Futures Radio Show

Elite only

Machine Learning - Quantitative Trading w/Martin Froehler @ Quantiacs

Elite only

Market Dynamics w/Peter Davies @ Jigsaw Trading

Elite only

Ask Me Anything w/Patrick Rooney @ Trading Technologies

Apr 18

Ask Me Anything w/FuturesTrader71

Apr 19

Machine Learning w/Kris Longmore

Elite only

Market Analysis w/Dave Forss

Apr 25

Introducing iSystems with Stage 5 Trading

Apr 27
     

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 10:39 AM
Buyer Beware: Will Your Bond Fund Sting You? Quick Summary News and Current Events 0 December 13th, 2012 06: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 10: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 04:00 AM
Why Sanctions Against Iran Might Sting More This Time* Quick Summary News and Current Events 0 December 28th, 2011 05:50 PM


All times are GMT -4. The time now is 10:15 PM.

no new posts
Page generated 2017-03-24 in 0.08 seconds with 19 queries on phoenix via your IP 54.147.237.64