Getting a char out of a string
#1

All good now, works fine, thank you for your help though!
Reply
#2

Use %c (character).
Reply
#3

All good now, works fine, thank you for your help though!
Reply
#4

May I ask why you're trying to do that?
Reply
#5

I want to get some certain chars from one string and add them to another one, simple.
Reply
#6

You could try - strpack(STRING, STRING2[2], THESIZE);

https://sampwiki.blast.hk/wiki/Strpack

EDIT: Hmm, disregard this post
Reply
#7

Yes, but why? Are you actually trying to do something, or just fooling around? Can you give me an example of when this would be used?

The only thing I can think of that is capable of doing this is strmid. It takes a range of characters (or one, if you like) from one string and puts them into another string. You can then strins() that into the string you wanted to put the characters in.
Reply
#8

Код:
strpack(STRING, STRING2[I]);
I'm trying this, it has no positive result.
I'm trying to get some characters which I need from string A, and transfer them to string B. I can't of any other way=\
Reply
#9

EDIT: I've tried using the strmid function but the only problem is that it reset the DES string all the time. I want the chars to continue be added without the whole string being reset. Is there any way to do it?
Reply
#10

You need 3 strings.

new string[] = "Some string ()"
new string_dest[];
new string_insert[] = "insert 123 in to the brackets";

Use strmid to extract "123" and put it in string_dest, then strins string_dest into the 'string'.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)