Gamestudio Links
Zorro Links
Newest Posts
FXCM => AVA Trade Plugin???
by Martin_HH. 11/25/26 21:59
No connection to MT4
by Martin_HH. 11/23/26 06:38
MinMax function on History t6 file
by LucasJoshua. 11/21/26 14:28
What are you working on?
by rayp. 11/20/26 18:10
contractUpdate() is filtering if >2 rows
by mistery. 11/09/26 12:06
New Zorro version 3.15
by jcl. 11/09/26 09:24
Removing outliers from files
by jcl. 11/04/26 10:30
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (Martin_HH, 1 invisible), 13,072 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EvanTJ, rht, MaliceTheMaker, Haitao_Ren, JimSimons
19250 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
extract characters from a string #487344
03/21/23 19:23
03/21/23 19:23
Joined: Jul 2020
Posts: 9
England
D
Domino Offline OP
Newbie
Domino  Offline OP
Newbie
D

Joined: Jul 2020
Posts: 9
England
I have a 4 character and I wish to know what is the third character.
How di I extract a give character(s) ( character 3 or 4 to 5). Must be a function.

Re: extract characters from a string [Re: Domino] #487345
03/21/23 20:19
03/21/23 20:19
Joined: Aug 2017
Posts: 319
Netherlands
G
Grant Offline
Senior Member
Grant  Offline
Senior Member
G

Joined: Aug 2017
Posts: 319
Netherlands
Look for the strmid() function

Re: extract characters from a string [Re: Domino] #487346
03/21/23 20:22
03/21/23 20:22
Joined: Jun 2008
Posts: 60
Caucasus
VoroneTZ Offline
Junior Member
VoroneTZ  Offline
Junior Member

Joined: Jun 2008
Posts: 60
Caucasus
function GetChar(STRING* Astr, STRING* Aresult, int Anum) // Source, Result, Index of character
{
str_cpy(Aresult,(Astr.chars)[Anum]); //get 3rd char (i dunno why we have 4th char too)
str_trunc(Aresult,str_len(Aresult)-1); //delete all chars, except 1st
}

<...>
STRING* fstart="1234";
STRING* fresult="";
GetChar(fstart,fresult, 3); //copy 3rd char to fresult
printf(fresult.chars); // print result
<...>


Moderated by  HeelX 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1