Raised This Month: $32 Target: $400
 8% 

Replace first character in a string


Post New Thread Reply   
 
Thread Tools Display Modes
BaD CopY
Senior Member
Join Date: Oct 2014
Location: Home
Old 07-21-2018 , 15:13   Re: Replace first character in a string
Reply With Quote #11

Quote:
Originally Posted by fysiks View Post
Presumably that is the before and after characters.
Yeah, in that example 'a' is first character of string and 'A' is a value who will be replaced with 'a'..

How to detect values to replace with first character ?
BaD CopY is offline
Send a message via Yahoo to BaD CopY Send a message via Skype™ to BaD CopY
BaD CopY
Senior Member
Join Date: Oct 2014
Location: Home
Old 07-21-2018 , 15:37   Re: Replace first character in a string
Reply With Quote #12

Quote:
Originally Posted by fysiks View Post
Is this new string going to be a single character or more than one character? If it's always only 1 character, do what I said.
Also how to replace first 2 characters with some new values ?

Values { 'ho', '+' }

so string "home" will be "+me"
BaD CopY is offline
Send a message via Yahoo to BaD CopY Send a message via Skype™ to BaD CopY
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-21-2018 , 15:48   Re: Replace first character in a string
Reply With Quote #13

Quote:
Originally Posted by BaD CopY View Post
Also how to replace first 2 characters with some new values ?

Values { 'ho', '+' }

so string "home" will be "+me"
PHP Code:
new const szGivenString "home";

new const 
szReplaceString[ ][ ] =
{
    { 
"ho""+" }
}

replaceszGivenStringcharsmaxszGivenString ), szReplaceString][ ], szReplaceString][ ] ); 
__________________

Last edited by edon1337; 07-21-2018 at 15:49.
edon1337 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-21-2018 , 19:43   Re: Replace first character in a string
Reply With Quote #14

Quote:
Originally Posted by BaD CopY View Post
Also how to replace first 2 characters with some new values ?

Values { 'ho', '+' }

so string "home" will be "+me"
It sounds like you need to explain better what you are actually trying to do. You need to provide a bigger picture of your goal because your request doesn't make a whole lot of sense (without context) and you keep changing the request.
__________________
fysiks is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 07-21-2018 , 20:25   Re: Replace first character in a string
Reply With Quote #15

http://xyproblem.info
__________________
ddhoward is offline
BaD CopY
Senior Member
Join Date: Oct 2014
Location: Home
Old 07-22-2018 , 17:05   Re: Replace first character in a string
Reply With Quote #16

Quote:
Originally Posted by fysiks View Post
It sounds like you need to explain better what you are actually trying to do. You need to provide a bigger picture of your goal because your request doesn't make a whole lot of sense (without context) and you keep changing the request.
ok, my real idea is to make decoder and encoder for given strings..

PHP Code:
new name[32];

get_user_name(idnamecharsmax(name);

decode(name); 
I need decode function to replace each character of name with values for that character.. After that I need encode function to replace every two characters back to normal name.
BaD CopY is offline
Send a message via Yahoo to BaD CopY Send a message via Skype™ to BaD CopY
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-23-2018 , 22:16   Re: Replace first character in a string
Reply With Quote #17

And what is the purpose of all this? What are you actually using this for? What exactly does it mean to "decode" or "encode" in your case?
__________________
fysiks is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-24-2018 , 06:06   Re: Replace first character in a string
Reply With Quote #18

Quote:
Originally Posted by fysiks View Post
And what is the purpose of all this? What are you actually using this for? What exactly does it mean to "decode" or "encode" in your case?
He means like binaries.

What's the point of that?
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 07-24-2018 at 06:12.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-24-2018 , 06:26   Re: Replace first character in a string
Reply With Quote #19

Quote:
Originally Posted by fysiks View Post
What exactly does it mean to "decode" or "encode" in your case?
Compile and de-compile.
__________________
edon1337 is offline
BaD CopY
Senior Member
Join Date: Oct 2014
Location: Home
Old 07-24-2018 , 08:27   Re: Replace first character in a string
Reply With Quote #20

I need decoder to secure stored informations in database and encoder to show real values in game
BaD CopY is offline
Send a message via Yahoo to BaD CopY Send a message via Skype™ to BaD CopY
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode