mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2020
Posts: 4
S
Self-satisfied door
OP Offline
Self-satisfied door
S
Joined: Mar 2020
Posts: 4
Hi Community,

I search for Find the Longest Word in a String (Text)

search in String1-> This is a Sample for me and the Databasenetworkcontroller -> Find longest Word-> Databasenetworkcontroller
search in String1-> This is a Sample for the Databasenetworkmanager and me -> Find longest Word-> Databasenetworkmanager
search in String1-> the Sample for me and the Databasecontroller and all other users -> Find longest Word-> Databasecontroller

The Longest Word is on various Place and i want find and set to Variable.

Can anyone help me?

Big THX.

Joined: Dec 2015
Posts: 148
Vogon poet
Offline
Vogon poet
Joined: Dec 2015
Posts: 148
Code
alias longestword {
  tokenize 32 $1
  while ($len($2)) tokenize 32 $iif($len($1) > $v1,$1,$2) $3-
  return $1
}


//echo -a $longestword(This is a Sample for me and the Databasenetworkcontroller)

Last edited by Dazuz; 08/03/20 12:20 PM. Reason: brainfart and slight improvement
Joined: Mar 2020
Posts: 4
S
Self-satisfied door
OP Offline
Self-satisfied door
S
Joined: Mar 2020
Posts: 4
thank you for fast Reply and nice script. works perfect.


Link Copied to Clipboard