Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 232 results for
ltrim
- Page 1
Implementing String trimming (Ltrim and Rtrim) in C
Programming
Software Development
17 Years Ago
by ~s.o.s~
… is a simple implementation of implementing a simple Left trim (
ltrim
) and Right trim(rtim) of unwanted characters from a C…
Re: Implementing String trimming (Ltrim and Rtrim) in C
Programming
Software Development
11 Years Ago
by NTNKMR
void
ltrim
(char str[PATH_MAX]) { int i = 0, j = 0; char buf[PATH_MAX]; strcpy(buf, str); for(;str[i] == ' ';i++); for(;str[i] != '\0';i++,j++) buf[j] = str[i]; buf[j] = '\0'; strcpy(str, buf); }
Re: Implementing String trimming (Ltrim and Rtrim) in C
Programming
Software Development
17 Years Ago
by Nutty
it is a good, i like this type of programe
Re: Implementing String trimming (Ltrim and Rtrim) in C
Programming
Software Development
17 Years Ago
by StrikerX
Nice one, thanks .
Re: Implementing String trimming (Ltrim and Rtrim) in C
Programming
Software Development
17 Years Ago
by Ene Uran
How to you handle tabs?
Re: Implementing String trimming (Ltrim and Rtrim) in C
Programming
Software Development
17 Years Ago
by ~s.o.s~
> How to you handle tabs? If you will notice, this is not a generic function, the way we have in Python, Ruby and other languages. You need to pass the character to be stripped. If you want to strip off tabs, pass the junk character to be '\t'.
Re: Implementing String trimming (Ltrim and Rtrim) in C
Programming
Software Development
13 Years Ago
by Melando
Attention: rtrim could modify memory outside string range
Re: Implementing String trimming (Ltrim and Rtrim) in C
Programming
Software Development
13 Years Ago
by Narue
[QUOTE=Melando;1703232]Attention: rtrim could modify memory outside string range[/QUOTE] While you're correct, the bug report is unhelpful because you haven't specified when this would happen or suggested a fix. The problem stems from an unchecked decrement of [ICODE]original[/ICODE], which can drop below [ICODE]string[/ICODE] if it's empty of …
Re: Implementing String trimming (Ltrim and Rtrim) in C
Programming
Software Development
11 Years Ago
by Ancient Dragon
Ntnkmr: Your version does too much work -- it's not necessary to use a temporary buffer. Once you find the first non-space character move all remaining characters to the beginning of the line.
Re: Implementing String trimming (Ltrim and Rtrim) in C
Programming
Software Development
11 Years Ago
by nonlinearly
Narue, your code always retunrs the same results... the returned parameter string does not change anywhere in the function
Re: Implementing String trimming (Ltrim and Rtrim) in C
Programming
Software Development
11 Years Ago
by Ancient Dragon
The function is for right-trim, so the value of ***string*** will not change. All the function does is start at the end of ***string*** and work backwards until it finds the first non-***junk*** character, then truncates ***string*** at that point.
Re: Implementing String trimming (Ltrim and Rtrim) in C
Programming
Software Development
11 Years Ago
by nonlinearly
yes now I understand... but then it does not need to return anything because string is a pointer always to the same point...
Re: Implementing String trimming (Ltrim and Rtrim) in C
Programming
Software Development
11 Years Ago
by Ancient Dragon
Yes, it doesn't have to return anything, but string functions often do so that the function can be nested inside other fuctions, for example `printf("%s\n", rtrim(somestring, ' '));`
Could not continue scan with NOLOCK due to data movement
Programming
Databases
16 Years Ago
by vuyiswamb
… ' RESTORE DATABASE ' +
ltrim
(rtrim( @dbname )) + ' FROM DISK = ''' +
ltrim
(rtrim(@path)) +
ltrim
(rtrim( @filename )) + ''' ' select @sql =
ltrim
(rtrim(@sql)) + ' WITH… to physical name --select @sql =
ltrim
(rtrim(@sql)) + ' MOVE ''' +
ltrim
(rtrim(@dbname)) + '_Data' + ''' TO ''' +
ltrim
(rtrim(@path)) +
ltrim
(rtrim( @dbname )) + '.mdf'…
trouble with script registering data
Programming
Web Development
16 Years Ago
by justinmyoung
…(
ltrim
(strip_tags($city))); $state = rtrim(
ltrim
(strip_tags($state))); $fifteen = rtrim(
ltrim
(strip_tags($fifteen))); $fifteenl = rtrim(
ltrim
(strip_tags($fifteenl))); $fifteend = rtrim(
ltrim
(strip_tags($fifteend))); $mile = rtrim(
ltrim
…
Difficulty using while loop to insert the right data
Programming
Web Development
11 Years Ago
by nigelhow
…offerpricepl, -6); //$offernodecimal1 = str_replace('.', '', $last3charsoffer1); //$pips2 =
ltrim
($pips2, '0'); //$calcpips2=$calcpips/$minipipskiller; //$last3charsoffer = substr($row['… $pips); //removing the deci //$calcpips =
ltrim
($calcpips, '0');// remove zeros in front //$…
PHP Trim problem with dots in text
Programming
Web Development
6 Years Ago
by bprosic
… works, but when adding three dots, I get php warning
ltrim
(): Invalid '..'-range, no character to the right of '..' or invalid… "</code></pre>"; $code =
ltrim
($code, $textBeforeBlock); $code =
ltrim
($code, $pattern); } } // this is the end of code…
loop inside loop problem
Programming
Web Development
16 Years Ago
by neki
…("m", $row); $mjesec_od=
ltrim
($mjesec_od,0); $mjesec_do=
ltrim
($mjesec_do,0); $day_od=
ltrim
($day_od,0); $day_do=
ltrim
($day_do,0);?> <td>…
Re: Help!!! need query for latest record
Programming
Databases
15 Years Ago
by cgyrob
…Previous Accreditation Fee Paid' ,'' as 'POS Cycle' ,
LTRIM
((select i.firstName from individual i where i.individualid … aag.pc_id_mysql)as 'Primary Contact Title' ,
LTRIM
((select i.firstName from individual i where i.individualid… Accreditation Fee Paid' ,'' as 'POS Cycle' ,
LTRIM
((select i.firstName from individual i where i.individualid …
String Class operator+= Problem
Programming
Software Development
14 Years Ago
by Frederick2
… of where a particular String is in another String void
LTrim
(); //Returns String with leading spaces/tabs removed void RTrim();…0) //__tcsnicmp return i+1; } } } return 0; } void String::
LTrim
() { unsigned int i,iCt=0,iLenStr; iLenStr=this->LenStr…
Help with the Following SQl SP
Programming
Databases
15 Years Ago
by vuyiswamb
…(MAX) DECLARE @Pos INT DECLARE @rList VARCHAR(MAX) SET @list =
LTRIM
(RTRIM(@list)) + @Delim SET @pos = CHARINDEX(@delim, @list, 1) WHILE… @pos > 0 BEGIN SET @list1 =
LTRIM
(RTRIM(LEFT(@list, @pos - 1))) IF @list1 <> '' INSERT…
Help!!! need query for latest record
Programming
Databases
15 Years Ago
by KRichardson1127
…' ,aag.invoice_fee as 'Previous Accreditation Fee Paid' ,'' as 'POS Cycle' ,
LTRIM
((select i.firstName from individual i where i.individualid = aag… i where i.individualid = aag.pc_id_mysql)as 'Primary Contact Title' ,
LTRIM
((select i.firstName from individual i where i.individualid = aag…
Re: Help!!! need query for latest record
Programming
Databases
15 Years Ago
by KRichardson1127
…' ,aag.invoice_fee as 'Previous Accreditation Fee Paid' ,'' as 'POS Cycle' ,
LTRIM
((select i.firstName from individual i where i.individualid = aag… i where i.individualid = aag.pc_id_mysql)as 'Primary Contact Title' ,
LTRIM
((select i.firstName from individual i where i.individualid = aag…
How to combine different fetch record in same pagination
Programming
Web Development
15 Years Ago
by sandipan.rcciit
…=$val2[0]; $choice2=$val2[1]; $choice1=
ltrim
($choice1); //main entry data like 'database management' $choice2=
ltrim
($choice2); //token data like 'database' // how…
Flexcube Problem
Programming
Databases
15 Years Ago
by awo
…(a.txn_ccy,1,'N=',2,'USD',3,'GBP',13,'EUR')||
ltrim
(to_char(a.trans_amt, '999,999,999.99'))||chr(10)|| 'Details…(a.txn_ccy,1,'N=',2,'USD',3,'GBP',13,'EUR')||
ltrim
(to_char(a.trans_amt, '999,999,999.99'))||chr(10)|| 'Details…
DataAdapter - How do I set up create Insert, Update and Delete commands for your it?
Programming
Software Development
15 Years Ago
by emaduddeen
…;class.ClassName, " & _ "Student.StudentId,
LTrim
(Student.FirstName) & ' ' &
LTrim
(Student.LastName) AS StudentName, " & _ "…
Re: DataAdapter - How do I set up create Insert, Update and Delete commands for your it?
Programming
Software Development
15 Years Ago
by kvprajapati
…;class.ClassName, " & _ "Student.StudentId,
LTrim
(Student.FirstName) & ' ' &
LTrim
(Student.LastName) AS StudentName, " & _ "…
Re: DataAdapter - How do I set up create Insert, Update and Delete commands for your it?
Programming
Software Development
15 Years Ago
by emaduddeen
…;class.ClassName, " & _ "Student.StudentId,
LTrim
(Student.FirstName) & ' ' &
LTrim
(Student.LastName) AS StudentName, " & _ "…
Converting asp to .net using c#
Programming
Web Development
13 Years Ago
by sraj44
… & "'" sqlstr = sqlstr & " and right(rtrim(
ltrim
(tsi_trans_cd)),'" & len(trim(trans_code)) & "') = '"&…;> 'T' " sqlstr = sqlstr & " and right(rtrim(
ltrim
(tsi_trans_cd)),'" & len(trim(trans_code)) & "') = '"&…
ListBox update as data added to database
Programming
Software Development
13 Years Ago
by Hawk123
… INTO Products(ProductName,ProductDescription) VALUES ('" &
LTrim
(txtP.Text) & "', '" &
LTrim
(txtDesc.Text) & "') " cmd = New…
1
2
3
4
Next
Last
Search
Search
Forums
Forum Index
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2025 DaniWeb® LLC