•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 397,767 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,470 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser:
Views: 9640 | Replies: 0
![]() |
•
•
Join Date: Nov 2004
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
Hi
I am new to all of this so please forgive me if my question is either really obvious or indeed in the wrong forum.
I have had a script written for me that displays details of books e..t. title, author etc.
The string which holds the author seems to always have a space at the beginning of it. How can I remove the space (or indeed whatever other invisible character it is)?
The string value is $auth and the relevant part of the code (I think) is as follows:
If anyone can help me I would be most grateful.
Thanking you in anticipation.
Regards
Mark
I am new to all of this so please forgive me if my question is either really obvious or indeed in the wrong forum.
I have had a script written for me that displays details of books e..t. title, author etc.
The string which holds the author seems to always have a space at the beginning of it. How can I remove the space (or indeed whatever other invisible character it is)?
The string value is $auth and the relevant part of the code (I think) is as follows:
if ($productauthor =~ /\|\|/i) {
@auth = split(/\|\|/, $productauthor);
foreach $auth (@auth) {
$auth =~ s/^\s+//g;
$auth =~ s/\s+$//g;
$authorurl .= "\ \;<a href=\"search.cgi?key=$auth&author=1\">$auth</a>\ \;";
}
}else {
$authorurl = "<a href=\"search.cgi?key=$productauthor&author=1\">$productauthor</a>";
}If anyone can help me I would be most grateful.
Thanking you in anticipation.
Regards
Mark
Forum Administrator
www.accountancystudents.co.uk
... the site for ALL accountancy students
www.accountancystudents.co.uk
... the site for ALL accountancy students
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Shell Scripting Marketplace
- misplaced else and removing space characters (C++)
- Removing found chars from string (C)
- how to remove space from string? (PHP)
Other Threads in the Shell Scripting Forum
- Previous Thread: Script for automating the installation of a software
- Next Thread: .x ?!


Linear Mode