Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Trim Character in a String Post Reply Post New Topic
Author Message
achandana01
Groupie
Groupie
Avatar

Joined: 20 Jul 2011
Online Status: Offline
Posts: 59
Quote achandana01 Replybullet Topic: Trim Character in a String
    Posted: 04 Apr 2012 at 12:00pm
Hi,
 
I do have following strings
 
city newyork
Los Angeles
city San Francisco
 
I need to trim "city" from the strings which has city in em and leave the rest like they are.Results should look like this
 
newyork
Los Angeles
San Francisco
 
Thanks
chand
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 05 Apr 2012 at 5:19am
local stringvar y := {table.field}
local numbervar x := instr(y, "city");
 
if x = 1 then
    y:= trim(mid(y, 5);
 
y
 
HTH 
 
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.