Two Plus Two Newer Archives

Two Plus Two Newer Archives (http://archives1.twoplustwo.com/index.php)
-   Software (http://archives1.twoplustwo.com/forumdisplay.php?f=47)
-   -   How do I remove a slash / from a string with ahk? (http://archives1.twoplustwo.com/showthread.php?t=503951)

Johan L 09-18-2007 05:21 PM

How do I remove a slash / from a string with ahk?
 
Sample code:
Players=6/6
msgbox %Players%
Stringsplit,PlayersArray,%Players%,/
msgbox %PlayersArray1%
StringLeft,Player,%Players%,8
MsgBox %Player%

Both the StringSplit and StringLenft fails when a string contains a slash. Does anyone have a suggestion for how to get rid of the slash? I want to know how many players there are at the table.

Regards Johan

butcha 09-18-2007 05:40 PM

Re: How do I remove a slash / from a string with ahk?
 
Hello Johan,

Welcome to the world of AHK [img]/images/graemlins/smile.gif[/img]

Variables are not suppose to be surrounded by percent-signs in this instance.

This code works:

<font class="small">Code:</font><hr /><pre>Players=6/6
msgbox %Players%
Stringsplit,PlayersArray,Players,/
msgbox %PlayersArray1%
StringLeft,Player,Players,8
MsgBox %Player%
</pre><hr />

/butcha

Johan L 09-18-2007 06:05 PM

Re: How do I remove a slash / from a string with ahk?
 
Thanks!


All times are GMT -4. The time now is 08:00 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.