Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

How do I remove colorcodes from a string?

$
0
0
I've got word-wrapping system on my server that uses strlen, but for example taking this short text from SA-MP forum

SendClientMessage(playerid, COLOR_WHITE, "Welcome to {00FF00}M{FFFFFF}a{FF0000}r{FFFFFF}c{00FF00}o{FFFF FF}'{FF0000}s {FFFFFF}B{00FF00}i{FFFFFF}s{FF0000}t{FFFFFF}r{00FF 00}o{FFFFFF}!");


It would make the "Welcome to Marco's Bistro" look like "Welcome to Mar...(new line)...Co's Bistro" because strlen takes colorcodes into consideration. Let's see i make 2nd variable and want to store the text without colorcodes in it, how would I remove them?

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>