Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Remove from certian point
#1
Hey i was wondering how i could remove everything after a certian point?

Say i have,

QM_Expert: Hello forum.

How could i remove everything before the ":" sign? So i was left with just "Hello Forum."

Thanks.
#2
Macro ( Macro69 )
Code:
Copy      Help
str s a
a="QM_Expert: Hello forum."
s.get(a 11)
out s

Macro ( Macro70 )
Code:
Copy      Help
str s a
a="QM_Expert: Hello forum."
s.right(a 12)
out s
Taking on Quick Macros one day at a time
#3
OK thanks but i don think i specified enough sorry. the words to the left of the ":" sign will be different everytime depending on who sends the chat message, i was tihnking of using replacerx and replace everything to the left of the ":" sign. Any Help there ?

Thanks.
#4

Here is an example using replace, still not sure if this is what your wanting. But if I understand what you're wanting I don't think this is going to work for you?


Macro ( Macro73 )
Code:
Copy      Help
str s = "QM_Expert: Hello forum."
s.replace("" 0 11)
out s
Taking on Quick Macros one day at a time
#5
Nope that wont work because the 11 could be anything from 1-32....any ideas with replacerx?

Thanks
#6
Code:
Copy      Help
QmHelp("IDP_FINDC")
pi
#7
Hmmm im puzzeled on that one......it turns it into an int everytime? I need it to keep the text no matter what was before it.

For example if it was,

_pi: Hey everyone whats up.

Change it to "Hey everyone whats up."

or

QM_Expert: Hey everyone whats up.

Change it to "Hey everyone whats up."

Without changing it to an int :?:

Thanks
#8
OK nevermind i think i figured it out thanks _pi!
#9
fine.

now please show the rest of us your working example.

:roll:
pi
#10
str s = "QM_Expert: Hey everyone"
int i = findc(s ':')
str b.get(s i)
out b


Works just how i need it...Thanks
#11
QM_Expert Wrote:Hey i was wondering how i could remove everything after a certian point?

Say i have,

QM_Expert: Hello forum.

How could i remove everything before the ":" sign? So i was left with just "Hello Forum."

Thanks.

why would u need to remove things befor it if its a new topic???? looks like a party p question to me ..oh i see your trying to spam tables? and u need to remove the text that says to typ there oh ok i guess thats not cheating
#12
what you said makes no sense.
#13
what i mean is ...i just replyed and had to remove nothing to do it ?? just thought ur question was odd thats all? try set value


Forum Jump:


Users browsing this thread: 1 Guest(s)