简体   繁体   English

从 informatica 中的字符串中删除字符

[英]Remove character from string in informatica

I have the following string values.我有以下字符串值。

string 1 = test123 string 2 = stri567字符串 1 = test123 字符串 2 = stri567

now i need to remove 123,567 from the string.现在我需要从字符串中删除 123,567。 which means i need only first four character from the strings.(test,stri)这意味着我只需要字符串中的前四个字符。(test,stri)

Have you tried reg replace to replace all numbers from a string -您是否尝试过 reg replace 来替换字符串中的所有数字 -

REG_REPLACE( inp_col, '[0-9]','') 

If you need first four characters from the column then use substring如果您需要列中的前四个字符,请使用substring

SUBSTR(column_name, 0, 4)

Please make sure that you need first four digits or just strings from the columns.请确保您需要前四位数字或仅来自列的字符串。 In case if you need strings from the values, please use Koushik Roy's solution如果您需要值中的字符串,请使用 Koushik Roy 的解决方案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM