2731
Views
7
Comments
How to retrieve portion of string
Question

In The following exp

phoneno=codevalue+" "+phoneno

                                    How to retrieve phoneno alone using substring and index function

2022-06-17 09-22-26
Huarlem Lima

The 'index' function, return the position the found string.

The 'substring' function, retorna the part of a string, starting by index untill the quantity of the informed chars.


Example1:

index("+55 987654321"," ") = 3

substring("+55 987654321",3,10) = 987654321

lenght("+55 987654321") = 13


letting it dinamic:

var phoneno = "+55 987654321"

var size = lenght(phoneno)


var index = index(phoneno," ")

substring(phoneno ,index,size-index)


any questions, let me know.

UserImage.jpg
Prathmesh Bari

Hi Guys,

could u help me in extracting only characters from the alphanumeric string??

For Ex:

"3fAde63ckh2" is my string.

"Adeckh" should be my Output.


2024-02-16 07-43-18
Amit Verma

Prathmesh Bari wrote:

Hi Guys,

could u help me in extracting only characters from the alphanumeric string??

For Ex:

"3fAde63ckh2" is my string.

"Adeckh" should be my Output.


Hi Prathmesh,

Please use Regex_Replace function.



It is given an output as you expected

"fAdeckh"

Hope this will help :)

Best Regards,

Amit Verma

2026-02-26 06-29-24
Rahul
 
MVP

Prathmesh Bari wrote:

Hi Guys,

could u help me in extracting only characters from the alphanumeric string??

For Ex:

"3fAde63ckh2" is my string.

"Adeckh" should be my Output.


Hi Prathamesh,

You can use jquery or javascript fot this. here is the code

SyntaxEditor Code Snippet

function alphaOnly(a) {
    var b = '';
    for (var i = 0; i < a.length; i++) {
        if (a[i] >= 'A' && a[i] <= 'z') b += a[i];
    }
    $(".Abc").val(b);
}

see the below link

https://rahul-sahu.outsystemscloud.com/BPT_Test/test.aspx


If you need to serverside you have to find component or create own code in .net and intgrated in OS 

and i think regax is use for validation


THanks 

Rahul Sahu

2020-09-01 10-42-42
Stefano Valente

You need the Regex function.


Check the forge for that component. 

For more information on regex:

https://regex101.com/


2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Karthik,

If you are creating a web app, use the Regex_Replace Action from the Text Extension. If you are creating a mobile app, you can either create a JavaScript function yourself (though don't use JQuery, that's discouraged for performance reasons!), but you could also search the Forge to see if there's something like that available.

UserImage.jpg
Mohammed Faisal

Hi Guys,

I have two paragraphs, from that i want to extract two lines from those two paragraphs.

For example:

`

Work Targets

test

Success Profile

`

I want to get any data present in between Work targets and success profile.

Do help me out in this concern.

I tried using substring and index functions.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.