Inputs
-
MyString
-
String before
-
String behind
Outputs
Neuron type
Best algorithm has been found - locked
Patterns
Pattern |
Input |
Output |
1. |
MyString: |
abcdef |
String before: |
c |
String behind: |
e |
|
|
2. |
MyString: |
before ..:text:.. after |
String before: |
..: |
String behind: |
:.. |
|
|
3. |
MyString: |
1234567890 |
String before: |
23 |
String behind: |
67 |
|
|
Applicable neurons
-
Get after substring
-
Get before substring
-
Connect - four inputs
-
Price with VAT
-
Interrogative sentence
-
≤, ≥ opposite
-
character {
Algorithm
Test
Code made by AI:
/**
* Position: Search position substring of string
*
* @param x1 MyString
* @param x2 FindMe
* @return {Array}
*/
function neuron523(x1, x2)
{
return [x1.toString().indexOf(x2.toString())];
}
/**
* 0:
*
* @return {Array}
*/
function neuron500()
{
return [0];
}
/**
* Substring (startPosition, endPosition): Get substring from string - from position - to pos
*
* @param x1 MyString
* @param x2 start position
* @param x3 end position
* @return {Array}
*/
function neuron525(x1, x2, x3)
{
return[x1.toString().substring(x2, x3)];
}
/**
* Get before substring:
*
* @param x1 MyString
* @param x2 Substring
* @return {Array}
*/
function neuron532(x1, x2)
{
var outputs = [];
outputs[0] = x1;
outputs[1] = x2;
arr = neuron523(outputs[0], outputs[1]);
outputs[2] = arr[0];
arr = neuron500();
outputs[3] = arr[0];
arr = neuron525(outputs[0], outputs[2], outputs[3]);
outputs[4] = arr[0];
return[outputs[4]];
}
/**
* Length of string:
*
* @param x1 String
* @return {Array}
*/
function neuron528(x1)
{
return[x1.toString().length];
}
/**
* Length of string:
*
* @param x1 String
* @return {Array}
*/
function neuron528(x1)
{
return[x1.toString().length];
}
/**
* Substring (startPosition, endPosition): Get substring from string - from position - to pos
*
* @param x1 MyString
* @param x2 start position
* @param x3 end position
* @return {Array}
*/
function neuron525(x1, x2, x3)
{
return[x1.toString().substring(x2, x3)];
}
/**
* Substring (from position to end):
*
* @param x1 MyString
* @param x2 start position
* @return {Array}
*/
function neuron529(x1, x2)
{
var outputs = [];
outputs[0] = x1;
outputs[1] = x2;
arr = neuron528(outputs[0]);
outputs[2] = arr[0];
arr = neuron525(outputs[0], outputs[1], outputs[2]);
outputs[3] = arr[0];
return[outputs[3]];
}
/**
* Position: Search position substring of string
*
* @param x1 MyString
* @param x2 FindMe
* @return {Array}
*/
function neuron523(x1, x2)
{
return [x1.toString().indexOf(x2.toString())];
}
/**
* Get after substring:
*
* @param x1 MyString
* @param x2 Substring
* @return {Array}
*/
function neuron531(x1, x2)
{
var outputs = [];
outputs[0] = x1;
outputs[1] = x2;
arr = neuron528(outputs[1]);
outputs[2] = arr[0];
arr = neuron529(outputs[0], outputs[2]);
outputs[3] = arr[0];
arr = neuron523(outputs[0], outputs[1]);
outputs[4] = arr[0];
arr = neuron529(outputs[3], outputs[4]);
outputs[5] = arr[0];
return[outputs[5]];
}
/**
* Get substring between string1 and string2:
*
* @param x1 MyString
* @param x2 String before
* @param x3 String behind
* @return {Array}
*/
function neuron530(x1, x2, x3)
{
var outputs = [];
outputs[0] = x1;
outputs[1] = x2;
outputs[2] = x3;
arr = neuron532(outputs[0], outputs[2]);
outputs[3] = arr[0];
arr = neuron531(outputs[3], outputs[1]);
outputs[4] = arr[0];
return[outputs[4]];
}
Code made by AI: